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 2, 2021 02:09Yuriy LyfenkoYuriy LyfenkoScore: 147,340Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2021 02:09142,0011,223,957,745694,805,000999,0002,519,040
2Jul 2, 2021 02:09142,6361,222,939,491697,915,000999,0002,523,136
3Jul 2, 2021 02:09143,0921,228,735,617700,152,0001,000,0002,510,848
4Jul 2, 2021 02:09143,0981,226,594,835700,180,0001,000,0002,510,848
5Jul 2, 2021 02:09145,2541,241,079,455709,746,0001,999,0002,367,488
6Jul 2, 2021 02:09147,1441,242,582,601721,007,00002,514,944
7Jul 2, 2021 02:09147,3401,251,317,754720,966,000999,0002,523,136
8Jul 2, 2021 02:09147,7761,245,486,159723,100,0001,000,0002,506,752
9Jul 2, 2021 02:09148,7241,257,521,682726,750,0001,999,0002,375,680
10Jul 2, 2021 02:09154,1511,315,894,983755,340,80502,228,224
11Jul 2, 2021 02:09160,8541,358,309,242788,186,03802,232,320
12Jul 2, 2021 02:09161,1231,340,911,819789,501,99602,236,416