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:57Yuriy LyfenkoYuriy LyfenkoScore: 110,643Success
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:57110,5021,068,993,436539,460,0001,998,0002,342,912
2Dec 9, 2021 06:58110,5671,069,647,790539,779,0001,999,0002,478,080
3Dec 9, 2021 06:58110,5681,070,225,373539,786,0001,999,0002,478,080
4Dec 9, 2021 06:58110,5871,070,906,077540,878,000999,0002,473,984
5Dec 9, 2021 06:57110,5971,068,173,103540,928,000999,0002,260,992
6Dec 9, 2021 06:57110,6041,065,296,200540,961,000999,0002,478,080
7Dec 9, 2021 06:57110,6171,079,000,185541,023,0001,000,0002,478,080
8Dec 9, 2021 06:58110,6221,073,493,603542,050,00002,478,080
9Dec 9, 2021 06:58110,6231,074,696,641542,052,00002,482,176
10Dec 9, 2021 06:58110,6261,068,983,163542,066,00002,478,080
11Dec 9, 2021 06:58110,6361,068,940,590541,116,000998,0002,478,080
12Dec 9, 2021 06:57110,6371,068,143,025541,125,000998,0002,478,080
13Dec 9, 2021 06:58110,6431,065,834,254541,149,0001,000,0002,478,080
14Dec 9, 2021 06:57110,6501,065,019,323542,184,00002,482,176
15Dec 9, 2021 06:57110,6671,071,755,569540,270,0001,997,0002,478,080
16Dec 9, 2021 06:57110,6761,072,902,032541,313,0001,000,0002,478,080
17Dec 9, 2021 06:57110,6781,068,897,230541,323,0001,000,0002,478,080
18Dec 9, 2021 06:58110,6901,069,726,650542,379,00002,482,176
19Dec 9, 2021 06:58111,4321,115,793,142546,018,83002,211,840
20Dec 9, 2021 06:57111,4591,105,229,421546,150,25102,195,456
21Dec 9, 2021 06:57111,5021,106,926,229546,361,03702,191,360
22Dec 9, 2021 06:58111,5171,112,292,255546,433,23302,195,456
23Dec 9, 2021 06:58111,5191,107,167,015546,441,41902,195,456
24Dec 9, 2021 06:57111,5971,108,671,634546,825,84702,203,648