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:45Robert BurkeRobert BurkeScore: 85,466Success
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:4581,954451,920,224401,572,86402,285,568
2Jul 20, 2022 15:4581,954466,133,945401,572,48602,289,664
3Jul 20, 2022 15:4585,423442,817,085417,577,000998,0002,277,376
4Jul 20, 2022 15:4585,439438,198,835417,648,0001,001,0002,514,944
5Jul 20, 2022 15:4585,461440,599,336417,759,000999,0002,281,472
6Jul 20, 2022 15:4585,463436,803,960417,770,000999,0002,437,120
7Jul 20, 2022 15:4585,466441,392,020417,783,000999,0002,433,024
8Jul 20, 2022 15:4585,473439,659,112417,818,000999,0002,428,928
9Jul 20, 2022 15:4585,477445,214,849417,836,000999,0002,428,928
10Jul 20, 2022 15:4585,488444,619,125417,894,000999,0002,281,472
11Jul 20, 2022 15:4585,517440,500,458417,033,0002,000,0002,281,472
12Jul 20, 2022 15:45102,680585,814,264503,134,02002,289,664