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 9, 2021 12:20Yuriy LyfenkoYuriy LyfenkoScore: 110,789Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 9, 2021 12:20110,3491,070,800,635538,711,0001,998,0002,478,080
2Jul 9, 2021 12:20110,4921,069,300,836540,414,000998,0002,330,624
3Jul 9, 2021 12:20110,5881,067,799,763539,883,0001,999,0002,478,080
4Jul 9, 2021 12:20110,6091,068,096,774540,983,000999,0002,482,176
5Jul 9, 2021 12:20110,6281,066,107,006541,078,0001,000,0002,478,080
6Jul 9, 2021 12:20110,6841,066,247,079541,351,0001,000,0002,473,984
7Jul 9, 2021 12:20110,7891,072,589,026540,869,0001,999,0002,342,912
8Jul 9, 2021 12:20110,8421,066,235,949543,128,00002,482,176
9Jul 9, 2021 12:20110,8611,068,408,758542,218,0001,000,0002,478,080
10Jul 9, 2021 12:20121,8521,150,833,919597,074,75402,195,456
11Jul 9, 2021 12:20121,8591,157,413,211597,109,87502,195,456
12Jul 9, 2021 12:20121,9441,156,117,954597,526,60202,211,840