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 20, 2022 06:02Robert BurkeRobert BurkeScore: 112,836Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 06:02108,015586,981,293529,274,26302,285,568
2Jul 20, 2022 06:02108,130598,988,469529,836,02102,256,896
3Jul 20, 2022 06:02108,153597,878,330529,950,35602,252,800
4Jul 20, 2022 06:02112,808576,061,042550,759,0001,999,0002,281,472
5Jul 20, 2022 06:02112,823575,587,512551,833,000999,0002,281,472
6Jul 20, 2022 06:02112,832576,696,063551,876,000999,0002,281,472
7Jul 20, 2022 06:02112,836577,247,000551,896,000999,0002,277,376
8Jul 20, 2022 06:02112,885580,758,138552,137,0001,000,0002,281,472
9Jul 20, 2022 06:02112,894575,075,434552,179,0001,000,0002,428,928
10Jul 20, 2022 06:02112,914576,677,876552,281,000998,0002,428,928
11Jul 20, 2022 06:02112,935583,636,175551,385,0001,997,0002,424,832
12Jul 20, 2022 06:02112,954575,932,263551,475,0001,998,0002,281,472