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 19, 2025 00:45Ian MckibbenIan MckibbenScore: 749,728Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 19, 2025 00:45749,7043,699,049,7213,672,552,000999,0002,531,328
2Jan 19, 2025 00:45749,7083,699,811,4813,671,569,0001,998,0002,424,832
3Jan 19, 2025 00:45749,7123,699,041,0093,672,592,000999,0002,433,024
4Jan 19, 2025 00:45749,7133,697,702,9223,673,595,00002,531,328
5Jan 19, 2025 00:45749,7283,706,473,7133,671,671,0001,998,0002,428,928
6Jan 19, 2025 00:45749,7543,704,848,0383,672,797,000999,0002,269,184
7Jan 19, 2025 00:45749,7723,704,140,7373,672,884,000999,0002,531,328
8Jan 19, 2025 00:45749,8063,703,614,9193,672,052,0001,998,0002,531,328
9Jan 19, 2025 00:45749,8483,695,064,9493,672,256,0001,999,0002,531,328