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 22:01Yuriy LyfenkoYuriy LyfenkoScore: 154,185Success
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 22:01145,4831,239,777,649710,869,0001,999,0002,367,488
2Jun 6, 2021 22:01145,8681,240,348,364712,753,0001,999,0002,506,752
3Jun 6, 2021 22:01146,9651,241,327,631719,129,0001,000,0002,486,272
4Jun 6, 2021 22:01148,1961,255,691,207726,161,00002,506,752
5Jun 6, 2021 22:01149,4651,264,259,148730,382,0001,998,0002,510,848
6Jun 6, 2021 22:01150,7471,266,019,365737,662,000999,0002,506,752
7Jun 6, 2021 22:01154,1851,282,014,863754,506,000999,0002,359,296
8Jun 6, 2021 22:01154,3671,283,715,951754,400,0001,998,0002,510,848
9Jun 6, 2021 22:01155,8551,290,318,274761,692,0001,999,0002,510,848
10Jun 6, 2021 22:01160,0081,355,940,946784,038,36902,228,224
11Jun 6, 2021 22:01162,5941,365,479,294796,711,15402,228,224
12Jun 6, 2021 22:01162,9601,355,076,741798,504,35802,228,224