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 02:03Yuriy LyfenkoYuriy LyfenkoScore: 96,989Success
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 02:0396,920499,523,660472,910,0001,999,0002,265,088
2Dec 10, 2021 02:0396,923503,073,807472,926,0001,999,0002,334,720
3Dec 10, 2021 02:0396,953505,222,967475,069,00002,527,232
4Dec 10, 2021 02:0396,963495,562,708474,117,0001,000,0002,334,720
5Dec 10, 2021 02:0396,977545,680,374475,189,48002,211,840
6Dec 10, 2021 02:0396,984499,094,769475,220,00002,527,232
7Dec 10, 2021 02:0396,989500,880,069475,244,00002,527,232
8Dec 10, 2021 02:0396,993555,151,033475,268,03502,195,456
9Dec 10, 2021 02:0397,003501,088,239474,315,0001,000,0002,338,816
10Dec 10, 2021 02:0397,059507,901,061473,593,0001,998,0002,347,008
11Dec 10, 2021 02:0397,061502,870,306473,599,0001,998,0002,265,088
12Dec 10, 2021 02:0397,069545,202,329475,639,22402,215,936