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 08:05Yuriy LyfenkoYuriy LyfenkoScore: 100,224Success
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 08:0599,729541,015,149488,669,90102,195,456
2Dec 9, 2021 08:0599,738561,589,730488,717,76002,199,552
3Dec 9, 2021 08:0599,795557,303,469488,994,98802,199,552
4Dec 9, 2021 08:05100,185518,745,674489,908,000999,0002,338,816
5Dec 9, 2021 08:05100,192517,138,851488,944,0001,999,0002,342,912
6Dec 9, 2021 08:05100,221517,013,814489,081,0002,000,0002,351,104
7Dec 9, 2021 08:05100,224515,692,226491,100,00002,342,912
8Dec 9, 2021 08:05100,238514,881,443490,166,0001,000,0002,265,088
9Dec 9, 2021 08:05100,245517,274,804490,199,0001,000,0002,265,088
10Dec 9, 2021 08:05100,264515,966,646491,294,00002,265,088
11Dec 9, 2021 08:05100,272517,349,367490,334,000998,0002,265,088
12Dec 9, 2021 08:05100,309518,281,128490,514,000999,0002,338,816