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 20, 2022 15:41Robert BurkeRobert BurkeScore: 96,407Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 15:4185,117476,689,485417,074,94002,285,568
2Jul 20, 2022 15:4185,120486,322,635417,086,53502,248,704
3Jul 20, 2022 15:4185,150481,193,208417,235,11602,285,568
4Jul 20, 2022 15:4196,370495,758,502472,214,00002,428,928
5Jul 20, 2022 15:4196,381496,886,680472,268,00002,420,736
6Jul 20, 2022 15:4196,390500,596,659472,309,00002,281,472
7Jul 20, 2022 15:4196,407498,079,917471,394,000998,0002,424,832
8Jul 20, 2022 15:4196,421499,020,522471,464,0001,000,0002,428,928
9Jul 20, 2022 15:4196,427498,857,943471,495,000998,0002,424,832
10Jul 20, 2022 15:4196,444494,298,144471,576,000999,0002,277,376
11Jul 20, 2022 15:4196,474495,976,941470,725,0001,998,0002,428,928
12Jul 20, 2022 15:4196,529494,044,488471,995,000999,0002,281,472