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 07:58Robert BurkeRobert BurkeScore: 81,639Success
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 07:5878,041445,799,199382,401,80202,285,568
2Jul 21, 2022 07:5878,063450,057,131382,507,88002,281,472
3Jul 21, 2022 07:5878,448446,787,851384,393,62202,281,472
4Jul 21, 2022 07:5881,613422,554,973398,907,000999,0002,281,472
5Jul 21, 2022 07:5881,628423,782,554398,979,000999,0002,281,472
6Jul 21, 2022 07:5881,631424,047,128398,991,000999,0002,281,472
7Jul 21, 2022 07:5881,639423,406,534398,031,0002,000,0002,281,472
8Jul 21, 2022 07:5881,642437,650,322400,048,00002,281,472
9Jul 21, 2022 07:5881,645421,289,888399,060,0001,000,0002,424,832
10Jul 21, 2022 07:5881,660423,639,872399,133,0001,000,0002,281,472
11Jul 21, 2022 07:5881,668421,473,411400,175,00002,428,928
12Jul 21, 2022 07:5881,706424,532,882400,360,00002,424,832