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:25Yuriy LyfenkoYuriy LyfenkoScore: 102,951Success
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:25102,7691,027,714,604501,568,0001,998,0002,478,080
2Oct 28, 2021 17:25102,7841,032,144,467501,645,0001,998,0002,482,176
3Oct 28, 2021 17:25102,8411,030,186,367502,923,000999,0002,478,080
4Oct 28, 2021 17:25102,8591,035,351,527503,009,0001,000,0002,478,080
5Oct 28, 2021 17:25102,9021,031,339,526503,221,000998,0002,482,176
6Oct 28, 2021 17:25102,9311,035,485,083503,363,000998,0002,478,080
7Oct 28, 2021 17:25102,9511,031,003,933503,460,000998,0002,482,176
8Oct 28, 2021 17:25103,0001,031,204,058502,702,0001,998,0002,260,992
9Oct 28, 2021 17:25103,0131,032,602,644502,767,0001,999,0002,478,080
10Oct 28, 2021 17:25103,7311,072,080,484508,282,53402,191,360
11Oct 28, 2021 17:25103,7751,085,150,862508,498,91002,207,744
12Oct 28, 2021 17:25103,7761,071,175,394508,500,16102,195,456