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 22, 2022 18:29Robert BurkeRobert BurkeScore: 64,345Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 22, 2022 18:2963,643386,228,607311,849,29702,293,760
2Jul 22, 2022 18:2963,667377,582,489311,967,74502,285,568
3Jul 22, 2022 18:2963,734363,629,519312,297,69502,289,664
4Jul 22, 2022 18:2964,331337,824,564315,222,00002,281,472
5Jul 22, 2022 18:2964,337339,805,610315,253,00002,428,928
6Jul 22, 2022 18:2964,343339,746,495315,283,00002,281,472
7Jul 22, 2022 18:2964,345341,700,317315,292,00002,433,024
8Jul 22, 2022 18:2964,348337,969,151315,304,00002,281,472
9Jul 22, 2022 18:2964,348340,536,650315,307,00002,428,928
10Jul 22, 2022 18:2964,355339,880,334314,340,0001,001,0002,281,472
11Jul 22, 2022 18:2964,359341,572,660315,358,00002,281,472
12Jul 22, 2022 18:2964,375341,134,706315,438,00002,281,472