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:18Yuriy LyfenkoYuriy LyfenkoScore: 144,183Success
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:18140,1291,211,860,997684,636,0001,998,0002,519,040
2Jul 2, 2021 02:18140,3941,211,106,943686,932,000999,0002,510,848
3Jul 2, 2021 02:16140,4421,213,709,314687,168,0001,000,0002,510,848
4Jul 2, 2021 02:16140,5521,220,653,452686,704,0001,999,0002,514,944
5Jul 2, 2021 02:18140,7271,222,137,079687,563,0001,998,0002,260,992
6Jul 2, 2021 02:18140,9031,220,636,692688,428,0001,998,0002,510,848
7Jul 2, 2021 02:16141,0071,217,297,981689,933,000999,0002,514,944
8Jul 2, 2021 02:16141,3781,220,063,417690,753,0001,999,0002,371,584
9Jul 2, 2021 02:16143,1521,229,353,481700,444,000999,0002,260,992
10Jul 2, 2021 02:18143,3521,235,737,710700,426,0001,998,0002,367,488
11Jul 2, 2021 02:16143,4861,232,694,916702,081,0001,000,0002,519,040
12Jul 2, 2021 02:16143,9361,233,317,966705,287,00002,523,136
13Jul 2, 2021 02:18144,1831,232,940,566704,498,0001,998,0002,514,944
14Jul 2, 2021 02:18145,2561,239,245,676709,753,0001,999,0002,506,752
15Jul 2, 2021 02:18146,2411,242,668,643714,581,0001,998,0002,379,776
16Jul 2, 2021 02:16148,5931,253,750,254727,108,0001,000,0002,367,488
17Jul 2, 2021 02:16148,6181,254,716,117728,228,00002,510,848
18Jul 2, 2021 02:18152,5591,277,750,025745,540,0001,998,0002,510,848
19Jul 2, 2021 02:18153,7631,312,700,023753,436,92802,224,128
20Jul 2, 2021 02:16153,8521,320,283,998753,873,75302,224,128
21Jul 2, 2021 02:18154,2001,329,163,070755,581,78202,228,224
22Jul 2, 2021 02:18155,0421,333,754,018759,704,82002,232,320
23Jul 2, 2021 02:16156,3451,340,267,003766,092,42602,232,320
24Jul 2, 2021 02:16160,1411,362,575,161784,689,25002,228,224