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 listFeb 19, 2025 01:31Ian MckibbenIan MckibbenScore: 749,734Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 19, 2025 01:30749,6803,697,127,1383,672,435,000999,0002,420,736
2Feb 19, 2025 01:30749,6973,696,786,1033,672,514,000999,0002,531,328
3Feb 19, 2025 01:31749,6993,697,969,3083,672,528,000999,0002,428,928
4Feb 19, 2025 01:30749,7163,700,235,5543,671,610,0001,998,0002,269,184
5Feb 19, 2025 01:30749,7173,706,494,7033,673,613,00002,269,184
6Feb 19, 2025 01:30749,7233,702,633,7943,672,646,000999,0002,428,928
7Feb 19, 2025 01:30749,7343,700,888,1183,672,697,000999,0002,424,832
8Feb 19, 2025 01:30749,7403,695,602,8523,671,729,0001,998,0002,269,184
9Feb 19, 2025 01:31749,7723,700,427,2493,672,882,000999,0002,424,832
10Feb 19, 2025 01:31749,7833,698,590,9643,671,941,0001,998,0002,269,184
11Feb 19, 2025 01:30749,7853,703,991,6973,672,948,000999,0002,269,184
12Feb 19, 2025 01:30750,0393,697,632,6663,673,195,0001,998,0002,428,928