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:35Yuriy LyfenkoYuriy LyfenkoScore: 103,834Success
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:35103,7301,035,072,952508,279,00002,482,176
2Jul 9, 2021 12:35103,7391,034,700,249507,322,0001,000,0002,478,080
3Jul 9, 2021 12:35103,7791,036,196,068506,519,0001,998,0002,478,080
4Jul 9, 2021 12:35103,7911,035,077,453506,577,0001,998,0002,478,080
5Jul 9, 2021 12:35103,7931,035,104,411506,586,0001,998,0002,330,624
6Jul 9, 2021 12:35103,8271,035,035,033506,752,0001,999,0002,482,176
7Jul 9, 2021 12:35103,8341,034,758,944506,790,0001,999,0002,482,176
8Jul 9, 2021 12:35103,8361,035,523,994506,799,0001,999,0002,478,080
9Jul 9, 2021 12:35103,8421,039,336,598507,826,000999,0002,478,080
10Jul 9, 2021 12:35104,1771,062,599,838510,465,11802,203,648
11Jul 9, 2021 12:35104,2271,071,547,847510,711,57502,191,360
12Jul 9, 2021 12:35104,5891,070,046,948512,486,62902,191,360