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 20, 2021 03:30Yuriy LyfenkoYuriy LyfenkoScore: 152,337Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 20, 2021 03:32151,391800,274,271741,816,39902,215,936
2May 20, 2021 03:33151,705807,222,719743,355,83502,224,128
3May 20, 2021 03:30151,717810,945,828743,413,64402,228,224
4May 20, 2021 03:30151,741802,731,525743,530,29502,215,936
5May 20, 2021 03:33151,750803,155,808743,573,44302,228,224
6May 20, 2021 04:57151,863800,605,667744,128,61802,224,128
7May 20, 2021 04:57151,877811,607,279744,199,15402,232,320
8May 20, 2021 03:32151,879807,165,315744,207,04002,228,224
9May 20, 2021 03:32151,973801,192,123744,665,28902,207,744
10May 20, 2021 03:30152,061827,019,134745,101,32102,232,320
11May 20, 2021 03:30152,125797,984,780745,412,53002,224,128
12May 20, 2021 04:57152,128817,456,058745,426,10802,220,032
13May 20, 2021 04:57152,156808,542,394745,563,76102,220,032
14May 20, 2021 03:33152,337804,145,175746,452,28402,224,128
15May 20, 2021 04:57152,396829,426,780746,740,01602,224,128
16May 20, 2021 04:57152,429814,144,510746,903,70202,224,128
17May 20, 2021 03:32152,431817,165,834746,912,03002,220,032
18May 20, 2021 04:57152,447806,870,672746,990,61302,224,128
19May 20, 2021 03:32152,472826,300,204747,113,17602,220,032
20May 20, 2021 03:30152,515826,388,149747,322,33602,232,320
21May 20, 2021 03:30152,703799,627,502748,246,30602,228,224
22May 20, 2021 03:33152,809814,427,491748,763,02202,232,320
23May 20, 2021 03:32152,950816,534,100749,456,95402,260,992
24May 20, 2021 04:57153,080810,216,436750,093,06502,232,320
25May 20, 2021 04:57153,857806,348,507753,899,01402,220,032
26May 20, 2021 03:33154,595814,279,478757,515,45502,211,840
27May 20, 2021 03:33155,901837,077,344763,917,21902,228,224