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:23Advait IyerAdvait IyerScore: 744,825Success
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:23744,7613,676,994,7703,646,330,0002,998,0002,289,664
2Jan 10, 2025 18:23744,7683,680,593,8163,647,363,0001,998,0002,289,664
3Jan 10, 2025 18:23744,8073,682,620,6983,645,555,0003,997,0002,289,664
4Jan 10, 2025 18:23744,8143,677,727,3053,648,590,000999,0002,510,848
5Jan 10, 2025 18:23744,8253,678,013,1403,645,647,0003,997,0002,289,664
6Jan 10, 2025 18:23744,8653,677,702,1613,646,839,0002,998,0002,289,664
7Jan 10, 2025 18:23744,8733,684,844,2883,646,879,0002,998,0002,289,664
8Jan 10, 2025 18:23744,8893,678,295,2573,646,960,0002,998,0002,289,664
9Jan 10, 2025 18:23744,9673,678,376,2863,648,338,0001,998,0002,289,664