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 17:35Yuriy LyfenkoYuriy LyfenkoScore: 111,348Success
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 17:35107,149591,643,265525,028,21902,220,032
2Dec 9, 2021 17:35107,222597,788,503525,389,61002,228,224
3Dec 9, 2021 17:35109,559601,212,633536,837,24902,252,800
4Dec 9, 2021 17:35111,024570,848,836541,016,0003,000,0002,289,664
5Dec 9, 2021 17:35111,222569,685,896543,987,000999,0002,289,664
6Dec 9, 2021 17:35111,247567,957,399543,111,0002,000,0002,490,368
7Dec 9, 2021 17:35111,348573,937,767542,610,0002,997,0002,289,664
8Dec 9, 2021 17:35111,502573,947,274545,359,0001,000,0002,289,664
9Dec 9, 2021 17:35111,597569,636,522543,825,0002,999,0002,498,560
10Dec 9, 2021 17:35111,738571,658,292545,519,0001,998,0002,498,560
11Dec 9, 2021 17:35111,836573,968,979544,995,0002,999,0002,289,664
12Dec 9, 2021 17:35111,944580,108,820546,530,0001,998,0002,289,664