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 30, 2022 10:40Robert BurkeRobert BurkeScore: 64,473Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 23, 2022 09:3761,910373,073,769303,360,55702,256,896
2Jul 23, 2022 09:3761,915367,178,700303,382,04802,179,072
3Jul 30, 2022 10:4061,916367,189,216303,389,05202,183,168
4Jul 30, 2022 10:4061,954373,315,994303,572,77702,174,976
5Jul 23, 2022 09:3761,955375,495,813303,578,44002,174,976
6Jul 30, 2022 10:4062,226372,518,519304,908,63102,179,072
7Jul 23, 2022 09:3764,450340,702,488314,802,0001,002,0002,281,472
8Jul 23, 2022 09:3764,458337,521,720313,844,0001,999,0002,437,120
9Jul 30, 2022 10:4064,459339,375,109313,849,0001,999,0002,445,312
10Jul 23, 2022 09:3764,463338,031,583313,870,0001,999,0002,437,120
11Jul 23, 2022 09:3764,468339,566,500313,892,0001,999,0002,281,472
12Jul 30, 2022 10:4064,470337,885,765313,902,0001,999,0002,449,408
13Jul 23, 2022 09:3764,473340,915,479313,921,0001,999,0002,281,472
14Jul 30, 2022 10:4064,477337,345,684313,938,0001,999,0002,273,280
15Jul 30, 2022 10:4064,478343,143,377313,943,0001,999,0002,281,472
16Jul 23, 2022 09:3764,491336,944,988314,006,0002,000,0002,445,312
17Jul 30, 2022 10:4064,495341,365,774314,024,0002,000,0002,281,472
18Jul 23, 2022 09:3764,549338,610,030315,290,0001,000,0002,281,472
19Jul 23, 2022 09:3764,591342,661,055315,494,0001,001,0002,449,408
20Jul 30, 2022 10:4064,685339,515,342314,958,0001,999,0002,449,408
21Jul 23, 2022 09:3764,757342,286,696316,310,0001,000,0002,281,472
22Jul 30, 2022 10:4065,037348,492,267316,682,0001,997,0002,281,472
23Jul 30, 2022 10:4065,039345,587,049316,693,0001,998,0002,273,280
24Jul 30, 2022 10:4065,310343,234,534318,019,0002,000,0002,445,312