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 08:44Robert BurkeRobert BurkeScore: 109,694Success
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 08:44104,601579,405,740512,546,12802,285,568
2Jul 20, 2022 08:44104,651572,560,402512,791,48602,281,472
3Jul 20, 2022 08:44104,719563,444,190513,120,97902,293,760
4Jul 20, 2022 08:44109,641564,000,337535,243,0001,997,0002,428,928
5Jul 20, 2022 08:44109,652560,263,375537,296,00002,281,472
6Jul 20, 2022 08:44109,671559,974,328537,387,00002,281,472
7Jul 20, 2022 08:44109,694564,383,148536,503,000999,0002,281,472
8Jul 20, 2022 08:44109,697559,958,055536,518,000999,0002,514,944
9Jul 20, 2022 08:44109,707568,441,095536,567,000999,0002,281,472
10Jul 20, 2022 08:44109,708562,115,413536,570,000999,0002,281,472
11Jul 20, 2022 08:44109,712565,586,109536,590,000999,0002,428,928
12Jul 20, 2022 08:44110,779564,471,751541,820,000999,0002,428,928