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 listJun 6, 2021 23:07Yuriy LyfenkoYuriy LyfenkoScore: 136,461Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 6, 2021 23:07133,2941,179,261,797652,141,0001,000,0002,506,752
2Jun 6, 2021 23:07133,6251,185,308,492652,765,0001,999,0002,379,776
3Jun 6, 2021 23:07134,0471,181,267,631655,829,000999,0002,514,944
4Jun 6, 2021 23:07134,7161,182,442,989659,108,0001,000,0002,506,752
5Jun 6, 2021 23:07135,0271,191,453,069660,633,000999,0002,371,584
6Jun 6, 2021 23:07135,4751,190,097,897661,828,0001,999,0002,510,848
7Jun 6, 2021 23:07136,4611,198,766,136666,663,0001,998,0002,510,848
8Jun 6, 2021 23:07139,3591,212,049,511680,859,0001,999,0002,506,752
9Jun 6, 2021 23:07141,5151,221,334,331692,426,000999,0002,506,752
10Jun 6, 2021 23:07149,6041,295,484,020733,061,61502,236,416
11Jun 6, 2021 23:07150,1191,295,589,273735,583,53602,228,224
12Jun 6, 2021 23:07151,7631,305,599,648743,639,90902,224,128