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 listAug 21, 2021 17:53Yuriy LyfenkoYuriy LyfenkoScore: 113,787Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 21, 2021 17:53106,1021,093,328,794519,899,81702,203,648
2Aug 21, 2021 17:53106,1281,081,016,832520,029,53802,203,648
3Aug 21, 2021 17:53106,1601,078,622,793520,182,41702,207,744
4Aug 21, 2021 17:53113,6951,080,294,202556,105,0001,001,0002,498,560
5Aug 21, 2021 17:53113,7391,085,036,799556,320,0001,002,0002,498,560
6Aug 21, 2021 17:53113,7441,084,189,318557,344,00002,502,656
7Aug 21, 2021 17:53113,7871,080,189,917554,560,0002,997,0002,498,560
8Aug 21, 2021 17:53113,7921,079,685,589555,580,0002,002,0002,281,472
9Aug 21, 2021 17:53113,9101,086,507,076557,158,0001,002,0002,281,472
10Aug 21, 2021 17:53113,9821,088,810,361557,514,0001,000,0002,498,560
11Aug 21, 2021 17:53114,0591,087,103,380555,891,0002,999,0002,498,560
12Aug 21, 2021 17:53114,0711,092,277,076556,946,0002,003,0002,498,560