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 listDec 10, 2021 02:10Yuriy LyfenkoYuriy LyfenkoScore: 99,049Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 10, 2021 02:1098,291536,444,592481,627,40802,211,840
2Dec 10, 2021 02:1098,295539,081,176481,646,33002,211,840
3Dec 10, 2021 02:1098,415539,717,114482,232,83702,203,648
4Dec 10, 2021 02:1099,033515,941,710484,266,000998,0002,265,088
5Dec 10, 2021 02:1099,037512,428,427484,283,0001,000,0002,461,696
6Dec 10, 2021 02:1099,044508,102,256485,315,00002,265,088
7Dec 10, 2021 02:1099,049519,173,199484,340,0001,000,0002,527,232
8Dec 10, 2021 02:1099,078510,433,749484,481,0001,000,0002,342,912
9Dec 10, 2021 02:1099,093511,781,123483,560,0001,998,0002,465,792
10Dec 10, 2021 02:1099,108513,419,643483,629,0001,998,0002,527,232
11Dec 10, 2021 02:1099,151509,103,914484,840,000999,0002,338,816
12Dec 10, 2021 02:1099,181513,133,649484,986,000999,0002,265,088