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 10, 2025 18:39Advait IyerAdvait IyerScore: 724,245Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 10, 2025 18:39724,2123,576,834,0113,544,640,0003,997,0002,289,664
2Jan 10, 2025 18:39724,2243,575,225,3843,547,698,000999,0002,281,472
3Jan 10, 2025 18:39724,2263,581,486,8653,546,710,0001,999,0002,285,568
4Jan 10, 2025 18:39724,2323,581,686,7963,546,740,0001,998,0002,289,664
5Jan 10, 2025 18:39724,2453,578,140,1783,546,802,0001,998,0002,289,664
6Jan 10, 2025 18:39724,2473,578,022,6873,545,813,0002,998,0002,289,664
7Jan 10, 2025 18:39724,2563,584,288,2353,545,855,0002,998,0002,289,664
8Jan 10, 2025 18:39724,3073,581,211,4483,545,108,0003,997,0002,289,664
9Jan 10, 2025 18:39724,3163,578,300,5313,546,153,0002,997,0002,281,472