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:08Yuriy LyfenkoYuriy LyfenkoScore: 146,441Success
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:13139,9311,219,818,190683,663,0001,999,0002,367,488
2Jul 2, 2021 02:08141,5241,217,503,929692,467,000999,0002,510,848
3Jul 2, 2021 02:13141,7291,220,879,189692,473,0001,998,0002,510,848
4Jul 2, 2021 02:08142,0811,228,340,489695,196,0001,000,0002,383,872
5Jul 2, 2021 02:13142,5471,223,834,620697,482,000999,0002,523,136
6Jul 2, 2021 02:08143,4211,227,800,437700,766,0001,999,0002,260,992
7Jul 2, 2021 02:08143,6281,229,519,583702,777,000999,0002,514,944
8Jul 2, 2021 02:13144,2221,237,494,662705,688,000999,0002,510,848
9Jul 2, 2021 02:13144,2251,231,208,462704,702,0001,999,0002,510,848
10Jul 2, 2021 02:08144,2491,231,976,646704,823,0001,999,0002,510,848
11Jul 2, 2021 02:08145,8851,240,417,418713,838,000999,0002,523,136
12Jul 2, 2021 02:08146,2771,246,186,476714,756,0001,999,0002,510,848
13Jul 2, 2021 02:13146,4411,245,158,758715,562,0001,998,0002,519,040
14Jul 2, 2021 02:08146,4481,246,924,056715,595,0001,998,0002,514,944
15Jul 2, 2021 02:13147,2721,247,833,059720,633,000999,0002,514,944
16Jul 2, 2021 02:13147,5641,250,052,404722,062,0001,000,0002,519,040
17Jul 2, 2021 02:13149,0451,255,986,150729,322,000999,0002,260,992
18Jul 2, 2021 02:08150,4741,300,441,383737,321,00002,232,320
19Jul 2, 2021 02:08150,5221,267,351,578736,558,000999,0002,523,136
20Jul 2, 2021 02:13150,7031,305,098,835738,442,61202,228,224
21Jul 2, 2021 02:13152,0981,299,428,299745,280,69902,228,224
22Jul 2, 2021 02:08153,2891,316,249,447751,114,56502,248,704
23Jul 2, 2021 02:08155,1781,321,644,271760,372,19602,228,224
24Jul 2, 2021 02:13160,4941,338,757,025786,421,57902,252,800