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:45Robert BurkeRobert BurkeScore: 61,616Success
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:4558,988341,980,236289,040,42102,174,976
2Oct 4, 2022 11:4559,080349,785,248289,493,27502,183,168
3Oct 4, 2022 11:4560,045358,213,163294,222,54702,183,168
4Oct 4, 2022 11:4561,609324,706,338299,886,0001,999,0002,453,504
5Oct 4, 2022 11:4561,609326,475,863299,887,0001,999,0002,281,472
6Oct 4, 2022 11:4561,610324,953,427299,888,0001,999,0002,445,312
7Oct 4, 2022 11:4561,616327,165,489299,921,0001,999,0002,449,408
8Oct 4, 2022 11:4561,621327,698,783299,942,0001,999,0002,281,472
9Oct 4, 2022 11:4561,622329,287,424299,950,0001,999,0002,441,216
10Oct 4, 2022 11:4561,678328,459,004301,222,0001,000,0002,441,216
11Oct 4, 2022 11:4561,973332,017,306302,668,000998,0002,281,472
12Oct 4, 2022 11:4562,042331,113,716302,007,0002,000,0002,445,312