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 listDec 10, 2021 02:21Yuriy LyfenkoYuriy LyfenkoScore: 97,368Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 10, 2021 02:2196,908559,829,221474,850,55802,207,744
2Dec 10, 2021 02:2196,927544,500,874474,942,60502,207,744
3Jul 20, 2022 13:5897,010559,954,123475,348,51502,203,648
4Jul 20, 2022 13:5897,031549,854,272475,454,15202,207,744
5Jul 20, 2022 13:5897,087538,136,453475,725,65502,199,552
6Dec 10, 2021 02:2197,092546,458,523475,749,96502,203,648
7Jul 20, 2022 13:5897,276501,303,753475,655,000999,0002,334,720
8Jul 20, 2022 13:5897,339502,485,192474,960,0001,999,0002,527,232
9Dec 10, 2021 02:2197,354501,826,471475,035,0002,000,0002,265,088
10Jul 20, 2022 13:5897,355508,516,425475,038,0002,000,0002,260,992
11Dec 10, 2021 02:2197,356506,831,088476,043,0001,000,0002,338,816
12Dec 10, 2021 02:2197,363499,518,491476,081,0001,000,0002,347,008
13Jul 20, 2022 13:5897,368499,977,455476,105,0001,000,0002,265,088
14Dec 10, 2021 02:2197,370503,674,840475,113,0002,000,0002,347,008
15Jul 20, 2022 13:5897,373501,120,236476,130,0001,000,0002,265,088
16Jul 20, 2022 13:5897,375500,721,450477,138,00002,342,912
17Jul 20, 2022 13:5897,377504,443,660477,149,00002,265,088
18Jul 20, 2022 13:5897,380501,217,493477,164,00002,265,088
19Dec 10, 2021 02:2197,385501,742,756476,185,0001,000,0002,265,088
20Dec 10, 2021 02:2197,391499,745,012476,214,0001,000,0002,527,232
21Dec 10, 2021 02:2197,397502,379,888476,247,000998,0002,338,816
22Dec 10, 2021 02:2197,438508,417,101475,447,0001,997,0002,334,720
23Jul 20, 2022 13:5897,472504,425,234476,612,000999,0002,527,232
24Dec 10, 2021 02:2197,476506,139,834476,635,000999,0002,326,528