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:25Robert BurkeRobert BurkeScore: 97,615Success
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:2596,524536,716,559472,966,25702,281,472
2Jul 20, 2022 15:2596,547540,547,137473,079,53402,289,664
3Jul 20, 2022 15:2596,608526,115,325473,378,24802,289,664
4Jul 20, 2022 15:2597,520499,859,871475,851,0001,999,0002,424,832
5Jul 20, 2022 15:2597,540500,402,349476,945,000999,0002,281,472
6Jul 20, 2022 15:2597,557505,449,271476,030,0002,000,0002,281,472
7Jul 20, 2022 15:2597,615504,795,133477,316,000998,0002,277,376
8Jul 20, 2022 15:2597,626504,632,825477,368,0001,000,0002,281,472
9Jul 20, 2022 15:2597,643507,236,856477,451,000998,0002,281,472
10Jul 20, 2022 15:2597,670504,902,997478,585,00002,281,472
11Jul 20, 2022 15:2597,674509,540,957478,604,00002,281,472
12Jul 20, 2022 15:25110,893571,699,637542,378,0001,000,0002,424,832