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:26Yuriy LyfenkoYuriy LyfenkoScore: 101,973Success
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:26101,8961,028,277,242498,291,0001,000,0002,338,816
2Oct 28, 2021 17:26101,9041,024,306,291498,328,0001,000,0002,347,008
3Oct 28, 2021 17:26101,9371,027,217,124497,496,0001,997,0002,482,176
4Oct 28, 2021 17:26101,9461,032,598,237497,535,0001,998,0002,478,080
5Oct 28, 2021 17:26101,9631,030,789,394498,620,000999,0002,260,992
6Oct 28, 2021 17:26101,9681,032,493,808497,646,0001,998,0002,478,080
7Oct 28, 2021 17:26101,9731,027,177,852497,671,0001,998,0002,478,080
8Oct 28, 2021 17:26102,0121,025,376,128498,858,000999,0002,473,984
9Oct 28, 2021 17:26102,0341,026,168,538498,967,000999,0002,478,080
10Oct 28, 2021 17:26103,1081,065,298,150505,229,43302,191,360
11Oct 28, 2021 17:26103,2141,068,555,747505,749,52202,203,648
12Oct 28, 2021 17:26103,2411,074,812,015505,882,80002,195,456