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:02Yuriy LyfenkoYuriy LyfenkoScore: 103,850Success
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:02103,6701,034,775,172505,986,0001,999,0002,478,080
2Dec 9, 2021 07:02103,7141,031,971,794507,199,0001,000,0002,482,176
3Dec 9, 2021 07:02103,7211,037,938,913507,235,0001,000,0002,478,080
4Dec 9, 2021 07:02103,7411,033,181,618506,335,0001,997,0002,478,080
5Dec 9, 2021 07:02103,8241,033,355,784506,739,0001,998,0002,482,176
6Dec 9, 2021 07:02103,8331,039,736,149507,785,000999,0002,478,080
7Dec 9, 2021 07:02103,8501,033,904,814507,864,000999,0002,478,080
8Dec 9, 2021 07:02103,9161,030,952,361509,190,00002,482,176
9Dec 9, 2021 07:02103,9241,033,202,202508,230,000998,0002,482,176
10Dec 9, 2021 07:02104,2021,077,770,931510,591,21002,195,456
11Dec 9, 2021 07:02104,2121,072,130,233510,638,55402,191,360
12Dec 9, 2021 07:02104,4211,091,909,179511,665,16902,199,552