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 listSep 22, 2022 17:50Bernard TeoBernard TeoScore: 68,128Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 22, 2022 17:5068,097366,273,645332,676,000999,0002,396,160
2Sep 22, 2022 17:5068,103360,909,960332,707,000999,0002,396,160
3Sep 22, 2022 17:5068,112355,683,956331,752,0001,998,0002,281,472
4Sep 22, 2022 17:5068,114354,241,945332,762,000999,0002,396,160
5Sep 22, 2022 17:5068,117357,758,838331,776,0001,998,0002,404,352
6Sep 22, 2022 17:5068,119361,732,581331,783,0001,998,0002,281,472
7Sep 22, 2022 17:5068,128355,809,575332,829,000999,0002,281,472
8Sep 22, 2022 17:5068,131358,023,826331,841,0001,999,0002,281,472
9Sep 22, 2022 17:5068,138359,082,102333,877,00002,281,472
10Sep 22, 2022 17:5069,800394,651,855342,020,61602,269,184
11Sep 22, 2022 17:5069,873398,325,435342,376,47802,260,992
12Sep 22, 2022 17:5072,442426,906,273354,966,33502,260,992