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 11, 2025 06:04Advait IyerAdvait IyerScore: 744,846Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 11, 2025 06:05744,7233,679,822,1633,646,145,0002,998,0002,293,760
2Jan 11, 2025 06:04744,7413,678,020,6143,647,231,0001,998,0002,506,752
3Jan 11, 2025 06:05744,7563,684,423,4923,646,308,0002,997,0002,293,760
4Jan 11, 2025 06:05744,8203,677,906,9873,646,622,0002,998,0002,506,752
5Jan 11, 2025 06:04744,8463,678,556,1873,646,747,0002,998,0002,289,664
6Jan 11, 2025 06:04744,8773,681,258,0603,646,902,0002,997,0002,510,848
7Jan 11, 2025 06:04744,9273,677,049,7553,648,146,0001,998,0002,510,848
8Jan 11, 2025 06:04745,1323,677,864,7953,646,153,0004,996,0002,342,912
9Jan 11, 2025 06:04745,7213,683,228,6753,651,033,0002,998,0002,510,848