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:22Yuriy LyfenkoYuriy LyfenkoScore: 108,934Success
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:22108,6171,053,751,408531,223,0001,000,0002,478,080
2Jul 9, 2021 12:22108,6211,054,327,531531,245,0001,000,0002,482,176
3Jul 9, 2021 12:22108,6911,057,957,741531,587,000999,0002,482,176
4Jul 9, 2021 12:22108,7201,057,758,360531,728,000999,0002,478,080
5Jul 9, 2021 12:22108,7501,067,694,396531,876,000999,0002,523,136
6Jul 9, 2021 12:22108,7531,059,114,625530,890,0001,999,0002,478,080
7Jul 9, 2021 12:22108,9341,066,744,239531,777,0001,999,0002,482,176
8Jul 9, 2021 12:22108,9461,058,257,815532,838,000999,0002,473,984
9Jul 9, 2021 12:22109,0581,060,057,051533,386,000998,0002,461,696
10Jul 9, 2021 12:22120,3931,143,323,855589,926,49102,191,360
11Jul 9, 2021 12:22120,4781,151,042,268590,342,12702,199,552
12Jul 9, 2021 12:22121,2271,159,915,227594,013,74402,191,360