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:37Yuriy LyfenkoYuriy LyfenkoScore: 100,190Success
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:3799,7361,058,826,051488,707,39302,318,336
2Dec 9, 2021 07:3799,8491,053,007,190489,260,10802,191,360
3Dec 9, 2021 07:3799,9041,045,529,976489,530,44402,195,456
4Dec 9, 2021 07:37100,1481,019,921,491489,726,000999,0002,478,080
5Dec 9, 2021 07:37100,1621,017,088,471488,795,0001,999,0002,482,176
6Dec 9, 2021 07:37100,1721,016,929,950489,843,000999,0002,478,080
7Dec 9, 2021 07:37100,1901,017,043,019488,931,0001,999,0002,478,080
8Dec 9, 2021 07:37100,1911,021,161,369489,938,000999,0002,478,080
9Dec 9, 2021 07:37100,1921,014,690,923488,942,0001,999,0002,478,080
10Dec 9, 2021 07:37100,2321,020,807,596490,137,0001,000,0002,478,080
11Dec 9, 2021 07:37100,2451,016,452,424490,200,0001,000,0002,482,176
12Dec 9, 2021 07:37100,3121,021,099,743489,532,0001,998,0002,478,080