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 listJul 21, 2022 08:00Robert BurkeRobert BurkeScore: 81,661Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 21, 2022 08:0078,026442,043,174382,327,15202,281,472
2Jul 21, 2022 08:0078,072442,411,897382,550,75502,285,568
3Jul 21, 2022 08:0078,135460,225,782382,862,40102,285,568
4Jul 21, 2022 08:0081,589422,836,953398,785,000999,0002,281,472
5Jul 21, 2022 08:0081,619424,818,541398,934,000999,0002,428,928
6Jul 21, 2022 08:0081,645421,702,677399,060,0001,000,0002,281,472
7Jul 21, 2022 08:0081,661426,763,323399,140,0001,000,0002,281,472
8Jul 21, 2022 08:0081,681421,180,233399,239,0001,000,0002,281,472
9Jul 21, 2022 08:0081,685423,168,043399,256,0001,000,0002,281,472
10Jul 21, 2022 08:0081,748430,355,542398,568,0001,997,0002,281,472
11Jul 21, 2022 08:0081,750429,623,366398,577,0001,997,0002,281,472
12Jul 21, 2022 08:0096,059493,908,092468,691,0001,998,0002,514,944