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 06:55Yuriy LyfenkoYuriy LyfenkoScore: 110,651Success
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 06:55110,5771,065,279,867540,830,000999,0002,478,080
2Dec 9, 2021 06:55110,5981,068,858,281539,930,0001,999,0002,478,080
3Dec 9, 2021 06:55110,6221,064,798,636541,047,0001,000,0002,351,104
4Dec 9, 2021 06:55110,6231,066,111,658542,052,00002,478,080
5Dec 9, 2021 06:55110,6321,072,348,006541,098,0001,000,0002,478,080
6Dec 9, 2021 06:55110,6471,066,601,533542,171,00002,482,176
7Dec 9, 2021 06:55110,6511,066,326,044541,189,0001,000,0002,478,080
8Dec 9, 2021 06:55110,6741,068,725,294541,305,0001,000,0002,478,080
9Dec 9, 2021 06:55110,6901,073,187,774542,383,00002,334,720
10Dec 9, 2021 06:55111,5141,101,987,814546,416,87202,199,552
11Dec 9, 2021 06:55111,5891,100,797,979546,784,89502,207,744
12Dec 9, 2021 06:55111,6321,112,119,970546,996,79102,191,360