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 15:01Robert BurkeRobert BurkeScore: 65,147Success
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 15:0164,561374,977,350316,347,75602,289,664
2Jul 22, 2022 15:0164,570374,776,650316,393,99202,281,472
3Jul 22, 2022 15:0165,097341,896,014318,976,00002,277,376
4Jul 22, 2022 15:0165,102340,643,486318,001,0001,000,0002,281,472
5Jul 22, 2022 15:0165,118346,723,184318,079,0001,000,0002,281,472
6Jul 22, 2022 15:0165,121347,358,999318,093,0001,000,0002,424,832
7Jul 22, 2022 15:0165,147340,048,164318,220,0001,000,0002,277,376
8Jul 22, 2022 15:0165,147340,705,174318,221,0001,000,0002,424,832
9Jul 22, 2022 15:0165,150340,744,962319,236,00002,281,472
10Jul 22, 2022 15:0165,181348,135,294318,384,0001,001,0002,281,472
11Jul 22, 2022 15:0165,182344,696,944319,392,00002,281,472
12Jul 22, 2022 15:0165,437384,950,675320,640,26502,289,664