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 1, 2021 08:27gchebanovgchebanovScore: 189,113Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 1, 2021 08:27157,132827,743,651769,947,22202,220,032
2Jul 1, 2021 08:27157,347843,707,355771,001,96802,220,032
3Jul 1, 2021 08:27159,345836,951,609780,789,71202,220,032
4Jul 1, 2021 08:27189,009956,714,199926,142,00002,490,368
5Jul 1, 2021 08:27189,034950,273,250925,270,000999,0002,494,464
6Jul 1, 2021 08:27189,091949,895,216925,547,000999,0002,486,272
7Jul 1, 2021 08:27189,113953,777,004924,654,0001,999,0002,297,856
8Jul 1, 2021 08:27189,245951,858,771925,304,0001,998,0002,342,912
9Jul 1, 2021 08:27189,344954,749,973925,787,0001,999,0002,363,392
10Jul 1, 2021 08:27189,807955,382,155929,055,000998,0002,482,176
11Jul 1, 2021 08:27189,868961,235,366929,353,000999,0002,355,200
12Jul 1, 2021 08:27189,913957,953,857929,575,000999,0002,289,664