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 15:26Robert BurkeRobert BurkeScore: 99,974Success
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 15:2697,221532,426,034476,385,02702,289,664
2Jul 20, 2022 15:2697,226543,903,476476,407,68502,285,568
3Jul 20, 2022 15:2697,230528,590,847476,426,56802,277,376
4Jul 20, 2022 15:2699,933513,674,675488,672,000999,0002,281,472
5Jul 20, 2022 15:2699,967513,965,852488,837,000999,0002,277,376
6Jul 20, 2022 15:2699,970507,816,159488,853,000999,0002,281,472
7Jul 20, 2022 15:2699,974516,986,009488,872,000999,0002,424,832
8Jul 20, 2022 15:2699,976511,691,417488,885,000999,0002,428,928
9Jul 20, 2022 15:2699,987514,645,773488,935,000999,0002,424,832
10Jul 20, 2022 15:2699,998513,241,847489,990,00002,514,944
11Jul 20, 2022 15:26100,032517,657,237489,157,0001,000,0002,437,120
12Jul 20, 2022 15:26100,066516,208,356490,321,00002,514,944