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 listSep 22, 2022 12:20Bernard TeoBernard TeoScore: 71,858Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 22, 2022 12:1271,369376,895,269347,711,0001,998,0002,281,472
2Sep 22, 2022 12:1271,371374,998,971347,718,0001,998,0002,281,472
3Sep 22, 2022 12:1271,384377,507,824348,781,000999,0002,281,472
4Sep 22, 2022 12:2071,398377,395,942348,849,000999,0002,396,160
5Sep 22, 2022 12:2071,400376,554,808348,859,000999,0002,281,472
6Sep 22, 2022 12:1271,404374,798,573348,882,000999,0002,273,280
7Sep 22, 2022 12:2071,423375,397,494348,975,000999,0002,400,256
8Sep 22, 2022 12:1271,435372,724,160349,030,0001,000,0002,281,472
9Sep 22, 2022 12:1271,437375,593,872348,041,0002,000,0002,281,472
10Sep 22, 2022 12:1271,443378,683,624349,072,0001,000,0002,400,256
11Sep 22, 2022 12:1271,447374,741,676348,090,0002,000,0002,281,472
12Sep 22, 2022 12:1271,457381,736,217349,137,0001,000,0002,396,160
13Sep 22, 2022 12:2071,476376,237,267350,231,00002,281,472
14Sep 22, 2022 12:1271,486377,136,532349,280,0001,000,0002,281,472
15Sep 22, 2022 12:1271,486378,648,349350,282,00002,408,448
16Sep 22, 2022 12:1271,493374,617,175350,317,00002,404,352
17Sep 22, 2022 12:2071,501376,393,659348,360,0001,996,0002,281,472
18Sep 22, 2022 12:1271,819375,533,333349,915,0001,999,0002,400,256
19Sep 22, 2022 12:1271,858376,701,876350,106,0002,000,0002,281,472
20Sep 22, 2022 12:1271,907378,693,940352,342,00002,400,256
21Sep 22, 2022 12:2071,963377,708,924350,621,0001,997,0002,400,256
22Sep 22, 2022 12:1273,202427,094,122358,688,49502,269,184
23Sep 22, 2022 12:1273,212429,725,455358,740,75602,260,992
24Sep 22, 2022 12:2073,223435,114,933358,794,06002,273,280
25Sep 22, 2022 12:1273,236442,847,198358,854,70402,265,088
26Sep 22, 2022 12:2073,239431,714,256358,873,06802,256,896
27Sep 22, 2022 12:1273,241424,291,342358,882,00402,269,184
28Sep 22, 2022 12:2073,272424,382,697359,035,05602,277,376
29Sep 22, 2022 12:1273,949384,902,921361,350,0001,000,0002,404,352
30Sep 22, 2022 12:1273,960389,549,887362,405,00002,400,256
31Sep 22, 2022 12:1273,966384,727,256362,434,00002,396,160
32Sep 22, 2022 12:2074,119394,114,673361,188,0001,995,0002,281,472
33Sep 22, 2022 12:2074,187387,208,938362,516,0001,001,0002,281,472
34Sep 22, 2022 12:2074,203390,706,822362,598,000998,0002,392,064
35Sep 22, 2022 12:1275,577445,173,598370,324,93002,265,088
36Sep 22, 2022 12:1275,578425,169,905370,331,70802,252,800