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:22Yuriy LyfenkoYuriy LyfenkoScore: 112,236Success
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:22111,124607,901,744544,509,67002,203,648
2Dec 9, 2021 07:22111,215608,465,084544,954,51702,207,744
3Dec 9, 2021 07:22111,917581,454,341546,397,0001,997,0002,347,008
4Dec 9, 2021 07:22111,967580,309,836546,642,0001,998,0002,342,912
5Dec 9, 2021 07:22112,121575,290,073548,393,0001,000,0002,342,912
6Dec 9, 2021 07:22112,175575,461,346547,661,0001,998,0002,342,912
7Dec 9, 2021 07:22112,236579,742,097548,957,000999,0002,338,816
8Dec 9, 2021 07:22112,285571,644,883550,197,00002,330,624
9Dec 9, 2021 07:22112,333577,095,379550,434,00002,265,088
10Dec 9, 2021 07:22112,471626,225,047551,105,81702,199,552
11Dec 9, 2021 07:22112,510586,456,095550,301,0001,000,0002,334,720
12Dec 9, 2021 07:22112,655579,692,985551,009,0001,000,0002,527,232