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 listFeb 6, 2025 08:48Oleg KovalovOleg KovalovScore: 695,294Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 6, 2025 08:48694,8783,434,715,5163,400,905,0003,997,0002,330,624
2Feb 6, 2025 08:48695,0193,429,236,1353,403,594,0001,999,0002,478,080
3Feb 6, 2025 08:48695,0773,429,661,2013,402,881,0002,998,0002,330,624
4Feb 6, 2025 08:48695,2413,435,334,7283,405,682,000999,0002,330,624
5Feb 6, 2025 08:48695,2943,433,706,4063,404,945,0001,998,0002,486,272
6Feb 6, 2025 08:48695,3133,439,302,9283,404,037,0002,998,0002,486,272
7Feb 6, 2025 08:48695,3493,438,264,5883,404,214,0002,997,0002,330,624
8Feb 6, 2025 08:48695,5803,468,246,4203,405,343,0002,997,0002,330,624
9Feb 6, 2025 08:48696,0313,445,795,3613,404,555,0005,995,0002,330,624