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 listDec 9, 2021 07:38Yuriy LyfenkoYuriy LyfenkoScore: 100,173Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 9, 2021 07:3899,668553,357,147488,371,33702,203,648
2Dec 9, 2021 07:3899,737553,702,434488,712,05802,207,744
3Dec 9, 2021 07:4099,760541,439,963488,826,25102,322,432
4Dec 9, 2021 07:4099,820556,241,818489,117,54402,195,456
5Dec 9, 2021 07:5299,840552,547,293489,215,32102,199,552
6Dec 9, 2021 07:4099,857549,925,167489,299,06002,195,456
7Dec 9, 2021 07:40100,128519,232,123489,628,000999,0002,527,232
8Dec 9, 2021 07:40100,138519,104,685488,680,0001,998,0002,265,088
9Dec 9, 2021 07:52100,145523,986,629488,712,0001,998,0002,527,232
10Dec 9, 2021 07:38100,146517,041,310488,716,0001,998,0002,265,088
11Dec 9, 2021 07:40100,147516,145,543488,721,0001,998,0002,265,088
12Dec 9, 2021 07:38100,150515,514,276489,738,000999,0002,342,912
13Dec 9, 2021 07:52100,151516,372,497488,741,0001,998,0002,342,912
14Dec 9, 2021 07:38100,151520,718,481488,742,0001,998,0002,527,232
15Dec 9, 2021 07:52100,153518,399,986489,751,000999,0002,342,912
16Dec 9, 2021 07:38100,167517,297,565488,817,0001,999,0002,338,816
17Dec 9, 2021 07:52100,167517,051,830489,818,000999,0002,265,088
18Dec 9, 2021 07:52100,170514,822,956489,835,000999,0002,265,088
19Dec 9, 2021 07:40100,173520,240,660489,849,000999,0002,265,088
20Dec 9, 2021 07:52100,183514,371,305488,900,0001,999,0002,342,912
21Dec 9, 2021 07:40100,199514,775,146489,975,000999,0002,265,088
22Dec 9, 2021 07:38100,203518,108,666488,995,0001,999,0002,334,720
23Dec 9, 2021 07:52100,204513,346,560491,002,00002,338,816
24Dec 9, 2021 07:40100,206519,294,053490,010,0001,000,0002,265,088
25Dec 9, 2021 07:52100,220566,957,328491,078,38802,203,648
26Dec 9, 2021 07:38100,222520,005,447490,086,0001,000,0002,347,008
27Dec 9, 2021 07:40100,226514,281,700491,106,00002,527,232
28Dec 9, 2021 07:40100,231520,926,545491,132,00002,330,624
29Dec 9, 2021 07:52100,236514,155,984490,158,0001,000,0002,527,232
30Dec 9, 2021 07:40100,246512,433,818490,203,0001,000,0002,527,232
31Dec 9, 2021 07:38100,252519,700,851490,235,0001,000,0002,342,912
32Dec 9, 2021 07:38100,262560,016,297491,282,34202,195,456
33Dec 9, 2021 07:38100,265521,939,844490,299,0001,000,0002,342,912
34Dec 9, 2021 07:38100,283524,746,964490,389,0001,000,0002,265,088
35Dec 9, 2021 07:52100,324522,608,605489,590,0001,998,0002,334,720
36Dec 9, 2021 07:52100,327572,479,608491,602,96002,203,648