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 listJul 20, 2022 15:15Yuriy LyfenkoYuriy LyfenkoScore: 96,959Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 15:1596,871537,228,079474,669,30002,211,840
2Jul 20, 2022 15:1596,910507,261,086473,862,000999,0002,342,912
3Jul 20, 2022 15:1596,934501,667,139473,977,000999,0002,461,696
4Jul 20, 2022 15:1596,934500,954,244472,978,0001,999,0002,461,696
5Jul 20, 2022 15:1596,938503,156,406473,995,000999,0002,527,232
6Jul 20, 2022 15:1596,941500,649,774475,010,00002,265,088
7Jul 20, 2022 15:1596,959500,013,482474,099,0001,000,0002,527,232
8Jul 20, 2022 15:1596,962499,260,203473,112,0002,000,0002,527,232
9Jul 20, 2022 15:1597,025502,267,249474,421,0001,000,0002,265,088
10Jul 20, 2022 15:1597,057541,997,024475,579,58102,195,456
11Jul 20, 2022 15:1597,059505,333,645473,591,0001,998,0002,265,088
12Jul 20, 2022 15:1597,629539,271,464478,383,99902,199,552