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:10Yuriy LyfenkoYuriy LyfenkoScore: 99,093Success
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:1098,351548,021,276481,917,93902,207,744
2Dec 10, 2021 02:1098,488542,689,643482,591,18502,195,456
3Dec 10, 2021 02:1098,987544,920,429485,035,94802,211,840
4Dec 10, 2021 02:1099,022516,503,348483,211,0001,996,0002,527,232
5Dec 10, 2021 02:1099,043520,674,565484,313,0001,000,0002,334,720
6Dec 10, 2021 02:1099,070511,328,106485,442,00002,437,120
7Dec 10, 2021 02:1099,093512,673,655484,557,000999,0002,334,720
8Dec 10, 2021 02:1099,093512,773,946483,559,0001,998,0002,265,088
9Dec 10, 2021 02:1099,103511,254,299484,608,000999,0002,265,088
10Dec 10, 2021 02:1099,108514,871,756483,629,0001,998,0002,265,088
11Dec 10, 2021 02:1099,112513,201,332483,650,0001,998,0002,527,232
12Dec 10, 2021 02:1099,170512,443,495483,932,0001,999,0002,338,816