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:50Yuriy LyfenkoYuriy LyfenkoScore: 111,701Success
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:50111,645573,396,549546,059,0001,000,0002,265,088
2Dec 10, 2021 01:50111,659576,212,212546,127,0001,000,0002,342,912
3Dec 10, 2021 01:50111,659576,710,232546,131,0001,000,0002,265,088
4Dec 10, 2021 01:50111,666578,053,296547,162,00002,265,088
5Dec 10, 2021 01:50111,672574,291,877546,191,0001,000,0002,338,816
6Dec 10, 2021 01:50111,676570,197,570547,213,00002,351,104
7Dec 10, 2021 01:50111,701575,064,595545,337,0001,997,0002,334,720
8Dec 10, 2021 01:50111,707572,541,166547,362,00002,527,232
9Dec 10, 2021 01:50111,764575,935,736545,644,0001,998,0002,527,232
10Dec 10, 2021 01:50112,231610,526,021549,930,25202,203,648
11Dec 10, 2021 01:50112,248620,810,408550,016,18802,199,552
12Dec 10, 2021 01:50112,256607,993,772550,055,97802,203,648