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 listJun 6, 2021 21:59Yuriy LyfenkoYuriy LyfenkoScore: 141,559Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 6, 2021 21:59134,2611,193,704,561656,878,000999,0002,510,848
2Jun 6, 2021 21:59135,0491,192,849,160659,742,0001,999,0002,387,968
3Jun 6, 2021 21:59136,6001,200,061,854667,343,0001,998,0002,506,752
4Jun 6, 2021 21:59137,4561,202,541,441671,537,0001,998,0002,367,488
5Jun 6, 2021 21:59139,2561,214,735,323681,356,000999,0002,514,944
6Jun 6, 2021 21:59140,3301,211,511,348686,618,000999,0002,510,848
7Jun 6, 2021 21:59141,5591,221,743,464692,640,000999,0002,510,848
8Jun 6, 2021 21:59145,9981,246,864,564713,392,0001,998,0002,510,848
9Jun 6, 2021 21:59147,3691,248,291,308721,107,0001,000,0002,510,848
10Jun 6, 2021 21:59150,5381,296,566,656737,634,38102,220,032
11Jun 6, 2021 21:59154,6361,312,003,257757,713,96702,236,416
12Jun 6, 2021 21:59157,1571,326,422,083770,070,20502,228,224