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 06:55Yuriy LyfenkoYuriy LyfenkoScore: 134,847Success
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 06:57131,1491,204,149,908642,632,07002,228,224
2Jul 2, 2021 06:56131,8121,205,566,065645,879,10002,232,320
3Jul 2, 2021 06:56132,0641,214,066,486647,114,08302,224,128
4Jul 2, 2021 06:57132,3741,217,204,985648,633,49002,236,416
5Jul 2, 2021 06:55132,6091,206,808,114649,781,79902,228,224
6Jul 2, 2021 06:55132,9231,221,886,375651,321,20202,232,320
7Jul 2, 2021 06:55133,0341,213,302,670651,868,44102,228,224
8Jul 2, 2021 06:57134,1781,184,678,676657,470,00002,514,944
9Jul 2, 2021 06:56134,2161,224,467,938657,658,31402,240,512
10Jul 2, 2021 06:56134,2611,179,118,602655,882,0001,999,0002,510,848
11Jul 2, 2021 06:57134,3281,190,803,046658,205,00002,510,848
12Jul 2, 2021 06:57134,3941,183,286,341656,535,0001,998,0002,510,848
13Jul 2, 2021 06:55134,4061,183,374,332657,589,000999,0002,510,848
14Jul 2, 2021 06:57134,4701,213,913,251658,902,01602,232,320
15Jul 2, 2021 06:56134,6411,184,831,063657,740,0001,999,0002,510,848
16Jul 2, 2021 06:55134,6701,191,748,960657,883,0001,999,0002,514,944
17Jul 2, 2021 06:56134,6991,184,308,765660,023,00002,510,848
18Jul 2, 2021 06:57134,7811,187,371,341658,428,0001,998,0002,506,752
19Jul 2, 2021 06:57134,8471,190,122,374658,752,0001,999,0002,375,680
20Jul 2, 2021 06:55134,8941,183,875,920658,980,0001,999,0002,510,848
21Jul 2, 2021 06:56135,0471,188,925,032659,731,0001,999,0002,514,944
22Jul 2, 2021 06:57135,1631,191,010,790661,301,0001,000,0002,383,872
23Jul 2, 2021 06:56135,2731,188,104,390660,838,0001,999,0002,514,944
24Jul 2, 2021 06:55135,5351,187,530,591663,122,0001,000,0002,510,848
25Jul 2, 2021 06:56135,6961,185,663,105663,911,000999,0002,510,848
26Jul 2, 2021 06:57135,7201,189,051,896663,030,0002,000,0002,510,848
27Jul 2, 2021 06:57136,0101,197,515,111664,452,0001,998,0002,363,392
28Jul 2, 2021 06:56136,2011,195,606,844665,388,0001,998,0002,506,752
29Jul 2, 2021 06:56136,2391,193,299,466666,572,000999,0002,510,848
30Jul 2, 2021 06:55136,5791,197,984,548668,240,000998,0002,510,848
31Jul 2, 2021 06:55136,6041,199,629,567667,361,0001,998,0002,514,944
32Jul 2, 2021 06:55136,6381,200,316,172667,529,0001,998,0002,510,848
33Jul 2, 2021 06:55136,8291,199,391,378669,463,000999,0002,514,944
34Jul 2, 2021 06:57136,8311,200,763,571668,473,0001,998,0002,510,848
35Jul 2, 2021 06:56137,1601,194,878,037671,083,0001,000,0002,371,584
36Jul 2, 2021 06:55138,2781,204,184,935675,565,0001,998,0002,510,848