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 2, 2021 14:27Yuriy LyfenkoYuriy LyfenkoScore: 131,375Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2021 14:27127,9521,152,454,164624,967,0001,999,0002,506,752
2Jul 2, 2021 14:27128,2841,154,564,092627,595,000999,0002,498,560
3Jul 2, 2021 14:27128,3501,153,692,984626,918,0001,999,0002,510,848
4Jul 2, 2021 14:27128,3531,151,325,681627,933,000999,0002,523,136
5Jul 2, 2021 14:27129,3251,162,610,194631,693,0001,999,0002,510,848
6Jul 2, 2021 14:27129,4001,165,896,690633,061,0001,000,0002,265,088
7Jul 2, 2021 14:27131,3751,174,934,371642,737,000999,0002,514,944
8Jul 2, 2021 14:27131,5291,170,055,134643,493,000999,0002,510,848
9Jul 2, 2021 14:27132,4761,177,605,849648,133,0001,000,0002,260,992
10Jul 2, 2021 14:27140,4661,257,811,509688,282,79502,224,128
11Jul 2, 2021 14:27140,9151,253,362,349690,481,37402,228,224
12Jul 2, 2021 14:27154,3311,323,283,507756,220,93702,220,032