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 11:43Robert BurkeRobert BurkeScore: 61,514Success
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 11:4359,455360,702,366291,330,40602,187,264
2Oct 4, 2022 11:4359,486353,392,082291,483,05402,187,264
3Oct 4, 2022 11:4360,201361,436,361294,986,57102,179,072
4Oct 4, 2022 11:4361,325326,120,859299,492,0001,001,0002,281,472
5Oct 4, 2022 11:4361,508327,263,835300,387,0001,001,0002,281,472
6Oct 4, 2022 11:4361,513328,299,793300,415,0001,001,0002,281,472
7Oct 4, 2022 11:4361,514324,919,765301,419,00002,437,120
8Oct 4, 2022 11:4361,514326,408,517300,420,0001,001,0002,281,472
9Oct 4, 2022 11:4361,517334,533,786300,430,0001,001,0002,281,472
10Oct 4, 2022 11:4361,576323,889,910299,725,0001,998,0002,273,280
11Oct 4, 2022 11:4361,606328,275,830299,870,0001,999,0002,449,408
12Oct 4, 2022 11:4361,609325,943,626299,883,0001,999,0002,281,472