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 12:17Bernard TeoBernard TeoScore: 76,188Success
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 12:1774,896440,160,377366,992,28802,273,280
2Sep 22, 2022 12:1774,918428,392,371367,099,70602,265,088
3Sep 22, 2022 12:1776,112401,949,214371,948,000999,0002,281,472
4Sep 22, 2022 12:1776,131393,698,710372,044,0001,000,0002,392,064
5Sep 22, 2022 12:1776,136397,142,871371,066,0002,000,0002,281,472
6Sep 22, 2022 12:1776,178396,420,276372,273,0001,000,0002,281,472
7Sep 22, 2022 12:1776,188400,497,827373,320,00002,281,472
8Sep 22, 2022 12:1776,199402,429,835372,372,0001,001,0002,281,472
9Sep 22, 2022 12:1776,212403,921,186373,440,00002,400,256
10Sep 22, 2022 12:1776,215404,426,933372,456,000998,0002,281,472
11Sep 22, 2022 12:1776,251400,293,539372,629,000999,0002,404,352
12Sep 22, 2022 12:1776,401447,331,793374,365,01002,273,280