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 listApr 27, 2024 12:10Hal FHal FScore: 61,976Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 12:1059,922350,090,011293,617,28402,285,568
2Apr 27, 2024 12:1060,054365,786,035294,263,26302,265,088
3Apr 27, 2024 12:1060,148362,201,778294,724,35202,265,088
4Apr 27, 2024 12:1061,936331,565,041302,486,0001,001,0002,527,232
5Apr 27, 2024 12:1061,961333,995,389300,614,0002,996,0002,289,664
6Apr 27, 2024 12:1061,973330,464,133300,674,0002,996,0002,289,664
7Apr 27, 2024 12:1061,976328,270,622301,684,0001,997,0002,367,488
8Apr 27, 2024 12:1061,977327,389,352301,682,0002,004,0002,523,136
9Apr 27, 2024 12:1061,983335,483,230300,719,0002,997,0002,289,664
10Apr 27, 2024 12:1062,010333,669,747300,849,0002,998,0002,289,664
11Apr 27, 2024 12:1062,628329,538,199304,880,0001,999,0002,273,280
12Apr 27, 2024 12:1062,636329,167,948303,916,0002,999,0002,289,664