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 21, 2022 23:07Robert BurkeRobert BurkeScore: 74,213Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 21, 2022 23:0770,330395,846,459344,614,98302,285,568
2Jul 21, 2022 23:0770,331400,997,045344,619,47402,285,568
3Jul 21, 2022 23:0770,365394,897,112344,788,38202,289,664
4Jul 21, 2022 23:0770,381411,272,227344,864,65802,293,760
5Jul 21, 2022 23:0770,481402,357,874345,358,62402,256,896
6Jul 21, 2022 23:0774,200385,849,535362,584,000998,0002,281,472
7Jul 21, 2022 23:0774,207391,402,266362,614,000998,0002,433,024
8Jul 21, 2022 23:0774,209387,970,967363,622,00002,424,832
9Jul 21, 2022 23:0774,209389,134,066362,628,000998,0002,428,928
10Jul 21, 2022 23:0774,211391,651,738362,637,000999,0002,281,472
11Jul 21, 2022 23:0774,213386,133,298362,647,000999,0002,428,928
12Jul 21, 2022 23:0774,213393,186,808362,643,000999,0002,424,832
13Jul 21, 2022 23:0774,213384,996,953362,645,000999,0002,424,832
14Jul 21, 2022 23:0774,216390,424,269362,660,000999,0002,428,928
15Jul 21, 2022 23:0774,223386,577,745361,697,0001,998,0002,281,472
16Jul 21, 2022 23:0774,232390,594,772361,737,0001,998,0002,281,472
17Jul 21, 2022 23:0774,237383,296,799362,762,000999,0002,424,832
18Jul 21, 2022 23:0774,237385,748,560361,763,0001,998,0002,514,944
19Jul 21, 2022 23:0774,237385,817,329362,762,000999,0002,281,472
20Jul 21, 2022 23:0774,248382,160,903361,815,0001,998,0002,281,472
21Jul 21, 2022 23:0774,264382,874,944362,896,000999,0002,281,472
22Jul 21, 2022 23:0774,418388,355,232363,648,000999,0002,424,832
23Jul 21, 2022 23:0774,485390,291,205363,979,000999,0002,433,024
24Jul 21, 2022 23:0780,170444,233,668392,834,28302,289,664