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:08Yuriy LyfenkoYuriy LyfenkoScore: 97,003Success
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:0896,903500,840,955473,826,000999,0002,342,912
2Jul 20, 2022 15:0896,963553,991,014475,116,50702,203,648
3Jul 20, 2022 15:0896,964494,811,750474,124,0001,000,0002,338,816
4Jul 20, 2022 15:0896,985502,173,851474,228,0001,000,0002,334,720
5Jul 20, 2022 15:0896,996558,786,660475,281,69902,203,648
6Jul 20, 2022 15:0896,996501,044,475475,281,00002,338,816
7Jul 20, 2022 15:0897,003496,713,088474,314,0001,000,0002,265,088
8Jul 20, 2022 15:0897,003506,332,292474,317,0001,000,0002,342,912
9Jul 20, 2022 15:0897,006499,417,640475,330,00002,265,088
10Jul 20, 2022 15:0897,060501,621,386473,597,0001,998,0002,269,184
11Jul 20, 2022 15:0897,067502,797,008474,628,000999,0002,338,816
12Jul 20, 2022 15:0897,495531,699,799477,724,50802,203,648