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 listMay 10, 2025 14:19Emanuele BolognesiEmanuele BolognesiScore: 2,315,507Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 10, 2025 14:192,311,72111,358,081,13311,322,435,0004,997,0002,310,144
2May 10, 2025 14:192,312,16111,362,194,30911,324,591,0004,997,000315,392
3May 10, 2025 14:192,313,70911,377,583,28711,333,176,0003,997,000180,224
4May 10, 2025 14:192,314,62211,377,312,83711,335,652,0005,996,0002,301,952
5May 10, 2025 14:192,315,50711,383,296,93711,340,985,0004,997,0002,281,472
6May 10, 2025 14:192,316,17211,382,796,95611,345,244,0003,997,0002,281,472
7May 10, 2025 14:192,317,49911,385,654,29911,349,749,0005,997,0002,281,472
8May 10, 2025 14:192,332,17611,458,863,03111,424,664,0002,998,0002,433,024
9May 10, 2025 14:192,335,04411,479,192,04811,435,718,0005,997,0002,514,944