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 15:31Robert BurkeRobert BurkeScore: 55,389Success
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 15:3152,955340,714,944259,481,88602,183,168
2Oct 4, 2022 15:3153,166325,688,282260,512,84202,301,952
3Oct 4, 2022 15:3155,093323,392,280269,957,42902,301,952
4Oct 4, 2022 15:3155,353295,691,016270,229,0001,000,0002,273,280
5Oct 4, 2022 15:3155,364290,137,777270,281,0001,001,0002,441,216
6Oct 4, 2022 15:3155,382298,906,236269,379,0001,995,0002,281,472
7Oct 4, 2022 15:3155,389297,088,899270,403,0001,001,0002,531,328
8Oct 4, 2022 15:3155,391299,522,187270,413,0001,001,0002,445,312
9Oct 4, 2022 15:3155,401296,127,158269,470,0001,996,0002,281,472
10Oct 4, 2022 15:3155,409306,611,197269,506,0001,996,0002,281,472
11Oct 4, 2022 15:3155,479299,011,737269,849,0001,998,0002,281,472
12Oct 4, 2022 15:3155,881297,272,666271,821,0001,998,0002,445,312