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 01:38Yuriy LyfenkoYuriy LyfenkoScore: 111,646Success
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 01:38111,601573,239,375545,844,000999,0002,265,088
2Dec 10, 2021 01:38111,613574,022,899544,906,0001,999,0002,265,088
3Dec 10, 2021 01:38111,623570,252,971545,954,000999,0002,330,624
4Dec 10, 2021 01:38111,627573,023,164544,972,0001,999,0002,527,232
5Dec 10, 2021 01:38111,628573,234,867544,977,0001,999,0002,265,088
6Dec 10, 2021 01:38111,642569,617,296546,044,0001,000,0002,527,232
7Dec 10, 2021 01:38111,646572,182,993545,067,0002,000,0002,265,088
8Dec 10, 2021 01:38111,681572,271,591546,237,0001,000,0002,342,912
9Dec 10, 2021 01:38111,681569,964,315546,238,0001,000,0002,330,624
10Dec 10, 2021 01:38112,389618,397,216550,708,27902,211,840
11Dec 10, 2021 01:38112,399626,193,778550,754,76002,203,648
12Dec 10, 2021 01:38114,757631,601,436562,307,88102,211,840