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:53Robert BurkeRobert BurkeScore: 81,623Success
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:5378,020449,213,480382,299,53902,285,568
2Jul 21, 2022 17:5378,069436,172,352382,539,87802,281,472
3Jul 21, 2022 17:5378,074440,547,527382,562,02302,293,760
4Jul 21, 2022 17:5381,601422,620,922398,846,000999,0002,428,928
5Jul 21, 2022 17:5381,614425,707,669398,911,000999,0002,281,472
6Jul 21, 2022 17:5381,621425,296,294399,941,00002,437,120
7Jul 21, 2022 17:5381,623426,195,781398,956,000999,0002,281,472
8Jul 21, 2022 17:5381,633422,162,201399,000,0001,000,0002,428,928
9Jul 21, 2022 17:5381,676421,177,267400,213,00002,424,832
10Jul 21, 2022 17:5381,686423,847,728399,263,0001,000,0002,281,472
11Jul 21, 2022 17:5381,761421,431,374399,629,000999,0002,433,024
12Jul 21, 2022 17:5383,645429,804,218408,863,000999,0002,428,928