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 22, 2022 00:42Robert BurkeRobert BurkeScore: 70,338Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 22, 2022 00:4267,905392,325,597332,736,80902,293,760
2Jul 22, 2022 00:4268,140393,109,484333,886,72802,277,376
3Jul 22, 2022 00:4270,240377,807,814343,175,0001,000,0002,433,024
4Jul 22, 2022 00:4270,262363,507,784344,285,00002,281,472
5Jul 22, 2022 00:4270,281366,590,511343,375,0001,001,0002,281,472
6Jul 22, 2022 00:4270,282366,259,733342,384,0001,996,0002,281,472
7Jul 22, 2022 00:4270,338369,151,755343,656,000999,0002,424,832
8Jul 22, 2022 00:4270,389365,572,729344,906,00002,428,928
9Jul 22, 2022 00:4270,392369,089,108343,924,000999,0002,428,928
10Jul 22, 2022 00:4270,442367,209,963344,168,0001,000,0002,281,472
11Jul 22, 2022 00:4270,603368,166,871342,958,0002,999,0002,281,472
12Jul 22, 2022 00:4280,674454,363,910395,303,27002,297,856