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 11:42Robert BurkeRobert BurkeScore: 102,111Success
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 11:4298,538560,905,316482,837,61602,281,472
2Jul 20, 2022 11:4298,551558,270,467482,900,48502,289,664
3Jul 20, 2022 11:4298,561553,567,003482,946,89002,281,472
4Jul 20, 2022 11:42102,025522,944,790498,922,000999,0002,277,376
5Jul 20, 2022 11:42102,056525,371,180499,074,0001,000,0002,281,472
6Jul 20, 2022 11:42102,109527,969,188500,336,00002,514,944
7Jul 20, 2022 11:42102,111522,572,362499,344,000998,0002,281,472
8Jul 20, 2022 11:42102,154519,807,678498,557,0001,998,0002,277,376
9Jul 20, 2022 11:42102,162525,942,895499,594,000999,0002,437,120
10Jul 20, 2022 11:42102,195521,789,695499,755,000999,0002,433,024
11Jul 20, 2022 11:42102,222522,198,820499,890,000999,0002,277,376
12Jul 20, 2022 11:42102,259523,978,148500,070,0001,000,0002,281,472