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 06:15Robert BurkeRobert BurkeScore: 65,817Success
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 06:1563,502383,342,908311,159,47602,293,760
2Jul 22, 2022 06:1563,519388,122,683311,242,61602,293,760
3Jul 22, 2022 06:1563,771370,758,023312,479,87002,293,760
4Jul 22, 2022 06:1565,778348,719,774322,314,00002,428,928
5Jul 22, 2022 06:1565,814347,002,895321,490,0001,001,0002,281,472
6Jul 22, 2022 06:1565,817344,748,360321,504,000998,0002,437,120
7Jul 22, 2022 06:1565,817346,681,112321,507,000998,0002,281,472
8Jul 22, 2022 06:1565,832349,413,555322,575,00002,420,736
9Jul 22, 2022 06:1565,842349,753,985320,631,0001,997,0002,420,736
10Jul 22, 2022 06:1565,852355,013,679321,677,000998,0002,281,472
11Jul 22, 2022 06:1565,864346,839,760321,733,000999,0002,281,472
12Jul 22, 2022 06:1566,255351,241,157322,653,0001,997,0002,433,024