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 2, 2021 02:19Yuriy LyfenkoYuriy LyfenkoScore: 146,992Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2021 02:19141,804724,629,820692,839,0001,999,0002,367,488
2Jul 2, 2021 02:19143,260730,485,638699,974,0001,999,0002,527,232
3Jul 2, 2021 02:19143,476729,236,628701,031,0002,000,0002,379,776
4Jul 2, 2021 02:19143,860727,250,746702,916,0001,999,0002,265,088
5Jul 2, 2021 02:19144,121735,959,671704,193,0002,000,0002,265,088
6Jul 2, 2021 02:19144,902738,637,538709,019,0001,000,0002,527,232
7Jul 2, 2021 02:19146,992748,852,713719,263,0001,000,0002,265,088
8Jul 2, 2021 02:19147,638750,505,798721,427,0001,998,0002,379,776
9Jul 2, 2021 02:19147,961751,517,951724,008,0001,000,0002,265,088
10Jul 2, 2021 02:19154,501829,286,756757,053,31702,244,608
11Jul 2, 2021 02:19154,712819,478,845758,087,44202,232,320
12Jul 2, 2021 02:19155,143816,537,881760,201,53502,248,704