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 24, 2022 14:30Yuriy LyfenkoYuriy LyfenkoScore: 92,581Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 24, 2022 14:3092,409477,623,236450,807,0001,999,0002,527,232
2Jul 24, 2022 14:3092,432479,667,443451,917,000999,0002,527,232
3Jul 24, 2022 14:3092,439483,151,072452,950,00002,527,232
4Jul 24, 2022 14:3092,472487,934,688452,114,000998,0002,265,088
5Jul 24, 2022 14:3092,491474,281,107452,205,0001,000,0002,265,088
6Jul 24, 2022 14:3092,542477,450,965452,457,000998,0002,338,816
7Jul 24, 2022 14:3092,581482,976,925451,650,0001,998,0002,338,816
8Jul 24, 2022 14:3092,584486,941,117451,664,0001,998,0002,265,088
9Jul 24, 2022 14:3092,616485,151,642451,819,0001,999,0002,265,088
10Jul 24, 2022 14:3093,876521,431,800459,992,49102,211,840
11Jul 24, 2022 14:3093,905516,607,716460,132,26002,203,648
12Jul 24, 2022 14:3093,913526,103,708460,171,50602,203,648