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 listSep 20, 2022 17:23Bernard TeoBernard TeoScore: 91,403Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 20, 2022 17:2391,330469,900,833445,519,0001,997,0002,281,472
2Sep 20, 2022 17:2391,357476,676,563447,647,00002,396,160
3Sep 20, 2022 17:2391,362476,646,398446,677,000999,0002,281,472
4Sep 20, 2022 17:2391,367473,727,818446,699,000999,0002,396,160
5Sep 20, 2022 17:2391,368469,197,342446,700,0001,001,0002,281,472
6Sep 20, 2022 17:2391,377473,555,792446,750,000999,0002,404,352
7Sep 20, 2022 17:2391,403477,443,341446,875,000999,0002,392,064
8Sep 20, 2022 17:2391,404470,816,477446,882,000999,0002,281,472
9Sep 20, 2022 17:2392,004475,704,747448,823,0001,999,0002,396,160
10Sep 20, 2022 17:2393,794533,732,305459,591,06402,265,088
11Sep 20, 2022 17:2393,809531,984,815459,663,16202,269,184
12Sep 20, 2022 17:2394,369520,115,197462,409,26702,256,896