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 listMay 25, 2021 18:37Yuriy LyfenkoYuriy LyfenkoScore: 170,557Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 25, 2021 18:38164,393844,162,302805,525,49502,244,608
2May 25, 2021 18:39164,723843,558,286807,144,96502,248,704
3May 25, 2021 18:39165,100869,289,532808,991,74602,236,416
4May 25, 2021 18:40165,858859,313,504812,703,89202,228,224
5May 25, 2021 18:40165,977867,816,218813,285,70502,232,320
6May 25, 2021 18:40166,181883,972,543814,284,67602,236,416
7May 25, 2021 18:37166,454852,197,841815,624,36702,232,320
8May 25, 2021 18:36167,012855,956,068818,359,55202,236,416
9May 25, 2021 18:38167,341863,327,099819,972,47502,232,320
10May 25, 2021 18:38168,609894,628,884826,181,80202,240,512
11May 25, 2021 18:39168,847867,800,019827,348,91302,244,608
12May 25, 2021 18:39169,111889,480,561828,645,55302,224,128
13May 25, 2021 18:39169,494868,149,703830,519,64002,232,320
14May 25, 2021 18:39170,557887,834,841835,729,73602,236,416
15May 25, 2021 18:36170,613902,322,137836,001,72902,236,416
16May 25, 2021 18:38170,875875,715,929837,289,06702,240,512
17May 25, 2021 18:39171,054892,084,457838,162,16802,240,512
18May 25, 2021 18:39171,506888,100,204840,378,77102,240,512
19May 25, 2021 18:40172,162892,083,339843,594,26202,232,320
20May 25, 2021 18:40172,264917,442,859844,092,32502,236,416
21May 25, 2021 18:38172,348892,160,431844,505,64002,236,416
22May 25, 2021 18:37173,358908,486,707849,453,92402,232,320
23May 25, 2021 18:39174,710898,959,003856,080,26102,228,224
24May 25, 2021 18:36177,718911,320,903870,817,86702,240,512
25May 25, 2021 18:40177,728907,576,155870,866,83402,236,416
26May 25, 2021 18:37178,293915,505,671873,634,90602,232,320
27May 25, 2021 18:38178,635949,936,167875,313,18002,240,512