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 13, 2025 08:08Ian MckibbenIan MckibbenScore: 1,280,616Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 13, 2025 08:081,267,8126,240,582,0806,208,285,0003,996,0002,363,392
2Jan 13, 2025 08:081,268,4686,244,303,8646,213,493,0001,998,0002,289,664
3Jan 13, 2025 08:081,271,2456,263,354,5376,226,103,0002,997,0002,289,664
4Jan 13, 2025 08:081,272,8766,263,770,4706,234,095,0002,997,0002,289,664
5Jan 13, 2025 08:081,273,1906,270,069,2136,235,635,0002,997,0002,289,664
6Jan 13, 2025 08:081,273,6616,273,546,5846,237,942,0002,996,0002,523,136
7Jan 13, 2025 08:081,276,7806,290,344,2416,253,228,0002,996,0002,281,472
8Jan 13, 2025 08:081,277,0256,286,834,0816,254,427,0002,997,0002,519,040
9Jan 13, 2025 08:081,277,6936,298,519,0646,258,698,0001,997,0002,289,664
10Jan 13, 2025 08:081,280,6166,312,996,3196,273,022,0001,998,0002,523,136
11Jan 13, 2025 08:081,281,2676,313,074,7146,276,208,0001,998,0002,281,472
12Jan 13, 2025 08:081,282,4626,318,747,5256,281,067,0002,996,0002,289,664
13Jan 13, 2025 08:081,282,7636,319,125,3386,284,542,000999,0002,289,664
14Jan 13, 2025 08:081,283,7536,324,976,4326,288,393,0001,998,0002,281,472
15Jan 13, 2025 08:081,284,0726,320,408,2516,288,954,0002,997,0002,289,664
16Jan 13, 2025 08:081,284,4206,324,155,4176,292,658,000999,0002,285,568
17Jan 13, 2025 08:081,293,8786,368,353,7096,339,003,000999,0002,269,184
18Jan 13, 2025 08:081,303,0366,412,731,7666,381,877,0002,997,0002,289,664