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 listOct 4, 2022 09:11Robert BurkeRobert BurkeScore: 62,176Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 09:1159,773364,113,400292,889,31402,191,360
2Oct 4, 2022 09:1159,789361,996,843292,964,89102,179,072
3Oct 4, 2022 09:1159,797350,452,586293,006,68002,183,168
4Oct 4, 2022 09:1159,801357,611,440293,024,52202,183,168
5Oct 4, 2022 09:1160,653352,811,804297,199,96702,183,168
6Oct 4, 2022 09:1161,237365,751,815300,059,11402,183,168
7Oct 4, 2022 09:1162,167334,069,340302,620,0001,997,0002,281,472
8Oct 4, 2022 09:1162,168329,267,724302,628,0001,997,0002,437,120
9Oct 4, 2022 09:1162,169329,187,893303,628,000998,0002,281,472
10Oct 4, 2022 09:1162,169327,406,102303,630,000998,0002,445,312
11Oct 4, 2022 09:1162,173329,921,733303,650,000998,0002,441,216
12Oct 4, 2022 09:1162,176330,589,815303,658,0001,002,0002,281,472
13Oct 4, 2022 09:1162,176331,361,145302,664,0001,997,0002,445,312
14Oct 4, 2022 09:1162,187334,014,175302,720,0001,998,0002,281,472
15Oct 4, 2022 09:1162,188326,903,518302,722,0001,998,0002,445,312
16Oct 4, 2022 09:1162,190325,844,563302,732,0001,998,0002,531,328
17Oct 4, 2022 09:1162,191323,748,044302,739,0001,998,0002,281,472
18Oct 4, 2022 09:1162,191329,224,893302,737,0001,998,0002,281,472
19Oct 4, 2022 09:1162,208327,704,179302,819,0001,998,0002,281,472
20Oct 4, 2022 09:1162,225328,622,554302,902,0001,999,0002,441,216
21Oct 4, 2022 09:1162,547334,009,842305,481,0001,001,0002,449,408
22Oct 4, 2022 09:1162,570334,385,171304,594,0001,997,0002,281,472
23Oct 4, 2022 09:1162,594329,559,294304,715,0001,998,0002,281,472
24Oct 4, 2022 09:1162,881330,027,106307,117,0001,000,0002,281,472