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 listDec 9, 2021 07:36Yuriy LyfenkoYuriy LyfenkoScore: 100,245Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 9, 2021 07:3699,703541,197,526488,547,09802,199,552
2Dec 9, 2021 07:3699,745550,829,877488,750,27102,199,552
3Dec 9, 2021 07:36100,125521,339,876488,614,0001,998,0002,338,816
4Dec 9, 2021 07:36100,170518,964,291488,833,0001,999,0002,265,088
5Dec 9, 2021 07:36100,214524,172,167489,050,0002,000,0002,523,136
6Dec 9, 2021 07:36100,230513,156,345490,126,0001,000,0002,461,696
7Dec 9, 2021 07:36100,245513,906,900491,202,00002,338,816
8Dec 9, 2021 07:36100,254514,864,556491,247,00002,265,088
9Dec 9, 2021 07:36100,264525,248,853490,296,0001,000,0002,465,792
10Dec 9, 2021 07:36100,275517,515,488491,347,00002,342,912
11Dec 9, 2021 07:36100,322517,074,049490,579,000999,0002,347,008
12Dec 9, 2021 07:36100,340565,605,358491,667,34002,207,744