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 10:16Robert BurkeRobert BurkeScore: 61,508Success
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 10:1659,407353,122,399291,092,88902,179,072
2Oct 4, 2022 10:1659,651357,132,823292,287,90302,179,072
3Oct 4, 2022 10:1659,691351,130,293292,486,39702,179,072
4Oct 4, 2022 10:1661,480327,809,460300,250,0001,000,0002,441,216
5Oct 4, 2022 10:1661,488322,014,459300,289,0001,000,0002,281,472
6Oct 4, 2022 10:1661,493325,168,748300,316,0001,001,0002,535,424
7Oct 4, 2022 10:1661,508333,590,981300,387,0001,001,0002,441,216
8Oct 4, 2022 10:1661,524331,233,186300,465,0001,001,0002,449,408
9Oct 4, 2022 10:1661,527330,666,543299,487,0001,996,0002,281,472
10Oct 4, 2022 10:1661,558332,470,336299,637,0001,997,0002,445,312
11Oct 4, 2022 10:1661,723324,260,147300,446,0001,996,0002,449,408
12Oct 4, 2022 10:1661,971333,751,663301,663,0001,997,0002,445,312