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 10, 2021 01:59Yuriy LyfenkoYuriy LyfenkoScore: 100,215Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 10, 2021 01:5999,669558,943,056488,377,73102,211,840
2Dec 10, 2021 01:5999,759551,954,344488,819,69602,207,744
3Dec 10, 2021 01:5999,768546,593,330488,861,99802,207,744
4Dec 10, 2021 01:59100,161516,337,629488,791,0001,999,0002,461,696
5Dec 10, 2021 01:59100,209523,758,361490,025,0001,000,0002,342,912
6Dec 10, 2021 01:59100,211515,459,428489,035,0002,000,0002,265,088
7Dec 10, 2021 01:59100,215517,447,310490,053,0001,000,0002,265,088
8Dec 10, 2021 01:59100,234512,515,695491,145,00002,347,008
9Dec 10, 2021 01:59100,250517,469,104491,223,00002,265,088
10Dec 10, 2021 01:59100,258521,283,905490,264,0001,000,0002,527,232
11Dec 10, 2021 01:59100,262513,858,170491,283,00002,330,624
12Dec 10, 2021 01:59100,322519,836,124489,581,0001,998,0002,527,232