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 listJul 22, 2022 00:44Robert BurkeRobert BurkeScore: 69,804Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 22, 2022 00:4467,736430,093,258331,906,20102,293,760
2Jul 22, 2022 00:4467,763395,432,680332,037,70102,285,568
3Jul 22, 2022 00:4467,783410,697,419332,136,12002,293,760
4Jul 22, 2022 00:4469,778363,810,034339,911,0001,999,0002,281,472
5Jul 22, 2022 00:4469,793368,086,203340,987,000999,0002,433,024
6Jul 22, 2022 00:4469,803362,705,965341,035,0001,000,0002,281,472
7Jul 22, 2022 00:4469,804361,254,585340,042,0002,000,0002,437,120
8Jul 22, 2022 00:4469,809363,653,389341,063,0001,000,0002,428,928
9Jul 22, 2022 00:4469,812363,810,932340,078,0002,000,0002,281,472
10Jul 22, 2022 00:4469,830369,458,658342,167,00002,428,928
11Jul 22, 2022 00:4469,854371,559,087340,292,0001,995,0002,281,472
12Jul 22, 2022 00:4469,911367,177,104340,567,0001,997,0002,281,472