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:24Yuriy LyfenkoYuriy LyfenkoScore: 108,142Success
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:24107,2521,089,582,998525,533,94502,203,648
2Oct 28, 2021 17:24107,3501,076,014,390526,017,22802,191,360
3Oct 28, 2021 17:24107,3891,100,970,274526,206,78902,318,336
4Oct 28, 2021 17:24108,0391,056,281,417527,392,0001,997,0002,478,080
5Oct 28, 2021 17:24108,1261,056,676,632527,818,0001,999,0002,482,176
6Oct 28, 2021 17:24108,1301,058,022,855527,838,0001,999,0002,478,080
7Oct 28, 2021 17:24108,1421,055,901,891527,895,0001,999,0002,482,176
8Oct 28, 2021 17:24108,1971,054,237,980529,164,0001,000,0002,478,080
9Oct 28, 2021 17:24108,2921,057,746,777529,633,000999,0002,478,080
10Oct 28, 2021 17:24108,2941,059,955,284528,643,0001,998,0002,478,080
11Oct 28, 2021 17:24108,3551,058,033,796528,942,0001,999,0002,478,080
12Oct 28, 2021 17:24108,4001,058,055,289531,159,00002,478,080