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 17:17Robert BurkeRobert BurkeScore: 80,754Success
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 17:1778,981449,639,608387,006,96502,285,568
2Jul 21, 2022 17:1779,008462,243,146387,139,49202,252,800
3Jul 21, 2022 17:1779,009445,329,778387,143,57302,289,664
4Jul 21, 2022 17:1780,741425,875,496394,633,000999,0002,281,472
5Jul 21, 2022 17:1780,742421,621,328395,635,00002,281,472
6Jul 21, 2022 17:1780,749412,846,045394,672,000999,0002,277,376
7Jul 21, 2022 17:1780,754421,224,586394,698,000999,0002,281,472
8Jul 21, 2022 17:1780,779417,201,239393,820,0001,999,0002,281,472
9Jul 21, 2022 17:1780,782419,024,453394,831,000999,0002,281,472
10Jul 21, 2022 17:1780,797422,928,527393,906,0001,999,0002,281,472
11Jul 21, 2022 17:1780,800424,039,824393,919,0001,999,0002,281,472
12Jul 21, 2022 17:1780,897423,889,772395,393,0001,000,0002,281,472