Format integers Sergey Svistunov

Compute a checksum over the decimal representations of binary integers as fast as possible.

Input: 250 000 000 uint32 values in little-endian binary on STDIN (4 bytes each).

Output: A uint64 checksum computed as:

CRC = sum of number_crc(n) for each n

where number_crc(n) converts n to its decimal string and sums ascii(digit) * position over each digit (0-indexed from the left).

Example: For n = 42, the decimal string is "42", so number_crc(42) = ascii('4') * 0 + ascii('2') * 1 = 52 * 0 + 50 * 1 = 50.

Back to listJun 15, 2024 04:30matsuoka-601matsuoka-601Score: 56,905Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 15, 2024 04:3052,700318,112,102258,229,32702,281,472
2Jun 15, 2024 04:3052,732323,228,232258,388,48302,285,568
3Jun 15, 2024 04:3054,892325,301,018268,970,00202,281,472
4Jun 15, 2024 04:3056,837305,917,640277,498,0001,001,0002,420,736
5Jun 15, 2024 04:3056,884304,656,529275,736,0002,997,0002,420,736
6Jun 15, 2024 04:3056,889307,110,962275,758,0002,997,0002,293,760
7Jun 15, 2024 04:3056,905304,877,497277,835,000999,0002,420,736
8Jun 15, 2024 04:3058,025306,988,687283,323,0001,001,0002,293,760
9Jun 15, 2024 04:3058,607316,577,099286,175,0001,000,0002,293,760
10Jun 15, 2024 04:3058,656309,755,552285,412,0002,002,0002,293,760
11Jun 15, 2024 04:3058,804310,391,890285,138,0003,001,0002,416,640
12Jun 15, 2024 04:3060,040320,957,458291,194,0003,002,0002,293,760