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 06:10Robert BurkeRobert BurkeScore: 113,921Success
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 06:10107,665591,165,936527,559,94902,285,568
2Jul 20, 2022 06:10107,686587,247,863527,662,18802,293,760
3Jul 20, 2022 06:10107,744599,450,262527,946,78802,289,664
4Jul 20, 2022 06:10113,880576,562,326558,014,00002,424,832
5Jul 20, 2022 06:10113,899577,790,134557,106,0001,000,0002,510,848
6Jul 20, 2022 06:10113,919578,691,612557,201,0001,000,0002,281,472
7Jul 20, 2022 06:10113,921581,615,328557,212,0001,000,0002,281,472
8Jul 20, 2022 06:10113,927584,833,021557,240,0001,000,0002,281,472
9Jul 20, 2022 06:10113,932586,741,692557,267,0001,000,0002,281,472
10Jul 20, 2022 06:10113,933588,509,354558,274,00002,281,472
11Jul 20, 2022 06:10113,966587,221,344556,435,0001,997,0002,433,024
12Jul 20, 2022 06:10113,995585,989,157557,577,000999,0002,420,736