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:46Robert BurkeRobert BurkeScore: 61,618Success
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:4658,961349,532,362288,909,09902,183,168
2Oct 4, 2022 11:4659,015353,194,430289,171,52802,174,976
3Oct 4, 2022 11:4659,267359,687,411290,407,18302,183,168
4Oct 4, 2022 11:4661,609324,590,757299,886,0001,999,0002,281,472
5Oct 4, 2022 11:4661,611327,634,404300,897,000999,0002,445,312
6Oct 4, 2022 11:4661,614324,405,656299,908,0001,999,0002,281,472
7Oct 4, 2022 11:4661,618329,143,631300,928,000999,0002,281,472
8Oct 4, 2022 11:4661,645329,621,137300,062,0002,000,0002,441,216
9Oct 4, 2022 11:4661,692332,957,779301,292,0001,000,0002,441,216
10Oct 4, 2022 11:4661,718334,127,837301,417,0001,001,0002,445,312
11Oct 4, 2022 11:4662,022325,873,649301,907,0001,999,0002,531,328
12Oct 4, 2022 11:4662,045329,341,842302,019,0002,000,0002,441,216