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 21, 2022 05:06Robert BurkeRobert BurkeScore: 81,899Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 21, 2022 05:0678,593446,132,820385,104,33802,281,472
2Jul 21, 2022 05:0678,643435,097,049385,348,36502,293,760
3Jul 21, 2022 05:0678,680440,552,560385,533,55602,289,664
4Jul 21, 2022 05:0681,865421,114,936401,137,00002,437,120
5Jul 21, 2022 05:0681,884428,566,650401,233,00002,437,120
6Jul 21, 2022 05:0681,895421,771,010401,287,00002,428,928
7Jul 21, 2022 05:0681,899430,719,432401,305,00002,281,472
8Jul 21, 2022 05:0681,912427,712,073400,371,0001,000,0002,281,472
9Jul 21, 2022 05:0681,912426,391,284400,373,000998,0002,277,376
10Jul 21, 2022 05:0681,918425,229,197399,400,0001,997,0002,281,472
11Jul 21, 2022 05:0681,967426,414,878400,637,000999,0002,277,376
12Jul 21, 2022 05:0682,086423,809,788402,219,00002,281,472