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 listJan 19, 2025 14:27MatthiasMatthiasScore: 505,608Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 19, 2025 14:27505,4692,504,659,1642,474,801,0001,999,0002,527,232
2Jan 19, 2025 14:27505,5332,502,979,1482,476,111,000999,0002,281,472
3Jan 19, 2025 14:27505,5942,503,556,1402,474,411,0002,998,0002,510,848
4Jan 19, 2025 14:27505,6072,507,757,2242,474,478,0002,998,0002,281,472
5Jan 19, 2025 14:27505,6082,501,594,4742,474,481,0002,998,0002,269,184
6Jan 19, 2025 14:27505,6382,501,658,1942,474,628,0002,998,0002,281,472
7Jan 19, 2025 14:27505,6822,505,732,6882,474,844,0002,998,0002,281,472
8Jan 19, 2025 14:27506,0122,505,199,3232,476,461,0002,998,0002,281,472
9Jan 19, 2025 14:27506,3822,511,098,9442,477,275,0003,997,0002,281,472