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:06Yuriy LyfenkoYuriy LyfenkoScore: 145,667Success
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:05140,1111,216,928,314684,547,0001,998,0002,260,992
2Jul 2, 2021 02:06140,6791,216,353,928687,329,0001,998,0002,514,944
3Jul 2, 2021 02:06141,3281,221,728,072689,510,0002,997,0002,506,752
4Jul 2, 2021 02:12141,3511,219,582,813690,621,0001,998,0002,506,752
5Jul 2, 2021 02:06141,4421,219,867,216693,067,00002,514,944
6Jul 2, 2021 02:06141,6271,216,641,911693,972,00002,519,040
7Jul 2, 2021 02:12141,8151,214,093,624693,893,000999,0002,510,848
8Jul 2, 2021 02:05141,8461,224,494,253694,047,0001,000,0002,514,944
9Jul 2, 2021 02:12141,8551,216,482,627695,091,00002,514,944
10Jul 2, 2021 02:05142,2081,219,107,787696,817,00002,510,848
11Jul 2, 2021 02:12142,4161,227,448,728695,841,0001,999,0002,371,584
12Jul 2, 2021 02:12142,4191,225,858,538694,854,0002,999,0002,510,848
13Jul 2, 2021 02:06142,4531,219,653,858697,021,0001,000,0002,519,040
14Jul 2, 2021 02:06142,5611,230,492,703696,549,0001,998,0002,510,848
15Jul 2, 2021 02:06143,1771,227,395,108700,566,000999,0002,523,136
16Jul 2, 2021 02:12143,5641,227,024,782702,466,000999,0002,523,136
17Jul 2, 2021 02:06143,7381,230,570,987702,317,0001,998,0002,510,848
18Jul 2, 2021 02:05144,0511,231,482,083703,849,0001,999,0002,514,944
19Jul 2, 2021 02:06144,2091,235,978,092705,627,000999,0002,260,992
20Jul 2, 2021 02:05144,2301,240,762,602704,726,0001,999,0002,260,992
21Jul 2, 2021 02:05144,3381,230,913,083706,258,000998,0002,260,992
22Jul 2, 2021 02:05144,7761,239,261,619707,402,0001,998,0002,510,848
23Jul 2, 2021 02:06144,9151,238,069,569709,084,0001,000,0002,523,136
24Jul 2, 2021 02:06145,1281,239,984,799711,126,00002,506,752
25Jul 2, 2021 02:12145,6671,243,637,093712,770,000999,0002,510,848
26Jul 2, 2021 02:06145,9351,246,526,533715,082,00002,260,992
27Jul 2, 2021 02:06146,3221,240,430,598716,978,00002,260,992
28Jul 2, 2021 02:05146,3441,245,099,234716,085,0001,000,0002,523,136
29Jul 2, 2021 02:06147,0641,253,065,126718,618,0001,998,0002,260,992
30Jul 2, 2021 02:12147,5001,253,979,629721,751,000999,0002,510,848
31Jul 2, 2021 02:06147,8391,249,555,670723,411,000999,0002,519,040
32Jul 2, 2021 02:12148,2411,254,083,015725,381,000999,0002,506,752
33Jul 2, 2021 02:05148,2931,257,089,831725,639,000999,0002,514,944
34Jul 2, 2021 02:06149,1141,256,852,305728,658,0001,999,0002,510,848
35Jul 2, 2021 02:06149,4181,265,764,081731,148,000998,0002,510,848
36Jul 2, 2021 02:06151,6821,270,207,295741,246,0001,997,0002,506,752
37Jul 2, 2021 02:05153,9351,310,534,681754,283,28502,240,512
38Jul 2, 2021 02:12153,9851,321,116,447754,524,55802,248,704
39Jul 2, 2021 02:06155,1331,319,952,663760,151,77902,232,320
40Jul 2, 2021 02:05155,1701,333,736,770760,330,91002,236,416
41Jul 2, 2021 02:06155,5181,319,432,157762,037,64002,228,224
42Jul 2, 2021 02:06156,2241,326,506,214765,497,74002,224,128
43Jul 2, 2021 02:06156,7241,348,714,161767,946,83402,228,224
44Jul 2, 2021 02:05157,4581,343,626,229771,545,08502,244,608
45Jul 2, 2021 02:12157,6151,338,613,975772,313,19402,240,512
46Jul 2, 2021 02:12157,8391,327,869,423773,412,19102,232,320
47Jul 2, 2021 02:06158,4931,355,024,406776,615,98902,228,224
48Jul 2, 2021 02:06161,4281,361,598,079790,996,03102,236,416