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 00:18Robert BurkeRobert BurkeScore: 70,353Success
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 00:1867,707412,996,079331,763,42802,293,760
2Jul 22, 2022 00:1867,720408,996,545331,826,35902,285,568
3Jul 22, 2022 00:1867,742388,162,818331,934,42402,277,376
4Jul 22, 2022 00:1870,284368,037,290343,390,0001,001,0002,277,376
5Jul 22, 2022 00:1870,327372,613,837343,603,000998,0002,424,832
6Jul 22, 2022 00:1870,331374,861,328342,627,0001,997,0002,433,024
7Jul 22, 2022 00:1870,353367,879,034342,733,0001,998,0002,281,472
8Jul 22, 2022 00:1870,359371,892,254343,762,000999,0002,424,832
9Jul 22, 2022 00:1870,413374,559,834343,023,0002,000,0002,424,832
10Jul 22, 2022 00:1870,430369,648,048344,109,0001,000,0002,281,472
11Jul 22, 2022 00:1870,446366,678,208345,183,00002,281,472
12Jul 22, 2022 00:1870,472368,387,349345,313,00002,281,472