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 12:33Advait IyerAdvait IyerScore: 1,041,256Success
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 12:331,040,5685,124,369,2874,972,865,000125,920,0002,293,760
2Jan 10, 2025 12:331,040,8435,127,667,9194,989,195,000110,937,0002,281,472
3Jan 10, 2025 12:331,040,9045,126,095,6244,960,499,000139,929,0002,281,472
4Jan 10, 2025 12:331,041,1715,138,576,0424,988,813,000112,927,0002,281,472
5Jan 10, 2025 12:331,041,2565,129,547,5974,961,231,000140,921,0002,281,472
6Jan 10, 2025 12:331,041,2655,132,729,5274,983,266,000118,934,0002,293,760
7Jan 10, 2025 12:331,041,6135,133,189,9714,971,985,000131,920,0002,510,848
8Jan 10, 2025 12:331,042,0385,132,204,0094,972,064,000133,920,0002,506,752
9Jan 10, 2025 12:331,045,2795,149,120,8334,991,921,000129,945,0002,281,472