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:21Yuriy LyfenkoYuriy LyfenkoScore: 108,711Success
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:21108,5691,051,878,432531,987,00002,523,136
2Jul 9, 2021 12:21108,6471,060,680,843532,369,00002,478,080
3Jul 9, 2021 12:21108,6601,059,082,749531,436,000998,0002,523,136
4Jul 9, 2021 12:21108,6891,061,708,818530,580,0001,998,0002,342,912
5Jul 9, 2021 12:21108,6941,060,219,527530,605,0001,998,0002,482,176
6Jul 9, 2021 12:21108,7051,058,568,819531,656,000999,0002,478,080
7Jul 9, 2021 12:21108,7111,067,289,950530,687,0001,998,0002,478,080
8Jul 9, 2021 12:21108,7361,062,354,069530,808,0001,999,0002,478,080
9Jul 9, 2021 12:21108,7721,056,117,781531,983,000999,0002,478,080
10Jul 9, 2021 12:21120,3471,144,677,349589,701,96502,195,456
11Jul 9, 2021 12:21120,4571,166,097,146590,237,46702,199,552
12Jul 9, 2021 12:21120,7201,160,476,448591,529,10202,191,360