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 17:47Bernard TeoBernard TeoScore: 73,168Success
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 17:4771,405375,767,954346,886,0002,999,0002,273,280
2Sep 22, 2022 17:4771,420371,938,283348,958,000999,0002,281,472
3Sep 22, 2022 17:4771,449386,105,624350,098,00002,281,472
4Sep 22, 2022 17:4771,460373,712,201349,153,0001,000,0002,281,472
5Sep 22, 2022 17:4771,496378,020,263349,330,0001,000,0002,400,256
6Sep 22, 2022 17:4771,891375,954,338352,268,00002,281,472
7Sep 22, 2022 17:4773,168417,837,761358,523,39302,260,992
8Sep 22, 2022 17:4773,192425,542,502358,640,15102,269,184
9Sep 22, 2022 17:4774,091390,835,571362,047,0001,000,0002,281,472
10Sep 22, 2022 17:4774,213391,980,735361,644,0001,998,0002,281,472
11Sep 22, 2022 17:4774,216391,674,772362,658,000999,0002,404,352
12Sep 22, 2022 17:4775,551438,202,305370,198,73602,265,088