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 listOct 28, 2021 17:30Yuriy LyfenkoYuriy LyfenkoScore: 106,748Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 28, 2021 17:30106,5411,048,265,511521,049,0001,000,0002,478,080
2Oct 28, 2021 17:30106,6681,049,868,362521,673,000999,0002,482,176
3Oct 28, 2021 17:30106,6751,050,981,751520,710,0001,998,0002,478,080
4Oct 28, 2021 17:30106,6801,046,463,215521,731,000999,0002,482,176
5Oct 28, 2021 17:30106,7051,052,648,880520,854,0001,999,0002,342,912
6Oct 28, 2021 17:30106,7091,052,141,704522,875,00002,260,992
7Oct 28, 2021 17:30106,7481,049,952,852523,063,00002,478,080
8Oct 28, 2021 17:30106,7491,045,625,718522,071,0001,000,0002,482,176
9Oct 28, 2021 17:30106,7611,046,561,056523,129,00002,478,080
10Oct 28, 2021 17:30107,5711,090,910,866527,100,09402,191,360
11Oct 28, 2021 17:30107,5961,110,054,262527,218,25702,195,456
12Oct 28, 2021 17:30107,6241,105,549,130527,355,46202,207,744