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:44Robert BurkeRobert BurkeScore: 62,333Success
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:4460,900355,453,127298,409,55602,187,264
2Oct 4, 2022 11:4460,907352,414,434298,442,49402,191,360
3Oct 4, 2022 11:4461,039371,370,070299,092,42602,174,976
4Oct 4, 2022 11:4462,318325,933,836304,358,0001,001,0002,281,472
5Oct 4, 2022 11:4462,330331,760,063303,419,0001,996,0002,281,472
6Oct 4, 2022 11:4462,333330,014,016304,430,0001,001,0002,281,472
7Oct 4, 2022 11:4462,333329,975,372304,431,0001,001,0002,445,312
8Oct 4, 2022 11:4462,346334,598,606303,498,0001,996,0002,441,216
9Oct 4, 2022 11:4462,402325,628,371303,772,0001,998,0002,449,408
10Oct 4, 2022 11:4462,478327,682,443305,142,0001,000,0002,437,120
11Oct 4, 2022 11:4462,663335,854,130306,048,0001,000,0002,281,472
12Oct 4, 2022 11:4463,224334,596,011307,799,0001,998,0002,441,216