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 13, 2025 14:49Valentin KofmanValentin KofmanScore: 958,006Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 13, 2025 14:49957,3464,720,960,5334,688,995,0001,999,0002,289,664
2Jul 13, 2025 14:49957,5674,721,427,8534,690,078,0001,999,0002,379,776
3Jul 13, 2025 14:49957,6874,716,920,2104,689,666,0002,998,0002,285,568
4Jul 13, 2025 14:49957,8174,725,144,2004,691,302,0001,999,0002,281,472
5Jul 13, 2025 14:49958,0064,720,776,7044,691,229,0002,998,0002,281,472
6Jul 13, 2025 14:49958,0614,724,265,0044,691,501,0002,998,0002,285,568
7Jul 13, 2025 14:49958,0674,730,088,8354,691,532,0002,997,0002,273,280
8Jul 13, 2025 14:49958,1314,730,820,6454,693,842,000999,0002,281,472
9Jul 13, 2025 14:49958,4044,725,076,9904,694,184,0001,998,0002,289,664