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 30, 2022 11:01Robert BurkeRobert BurkeScore: 65,087Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 30, 2022 11:0162,256360,519,760305,054,10702,187,264
2Jul 30, 2022 11:0162,317373,676,968305,351,27202,183,168
3Jul 30, 2022 11:0162,340376,214,363305,467,24802,183,168
4Jul 30, 2022 11:0165,006344,987,723317,529,0001,001,0002,281,472
5Jul 30, 2022 11:0165,019345,592,799316,594,0001,997,0002,281,472
6Jul 30, 2022 11:0165,035348,548,660316,676,0001,997,0002,281,472
7Jul 30, 2022 11:0165,087339,036,749317,928,000999,0002,281,472
8Jul 30, 2022 11:0165,089346,348,027317,936,000999,0002,281,472
9Jul 30, 2022 11:0165,091337,067,657316,945,0001,999,0002,281,472
10Jul 30, 2022 11:0165,103336,332,178317,005,0002,000,0002,445,312
11Jul 30, 2022 11:0165,257343,297,139317,762,0001,998,0002,441,216
12Jul 30, 2022 11:0165,461343,921,005319,762,000999,0002,449,408