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 listJun 6, 2021 22:00Yuriy LyfenkoYuriy LyfenkoScore: 151,547Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 6, 2021 22:00146,6491,253,444,402716,582,0001,998,0002,510,848
2Jun 6, 2021 22:00147,9711,249,808,354724,058,0001,000,0002,510,848
3Jun 6, 2021 22:00148,5641,257,771,691726,966,000999,0002,514,944
4Jun 6, 2021 22:00149,9731,259,012,064734,867,00002,510,848
5Jun 6, 2021 22:00150,4281,263,280,787736,098,0001,000,0002,510,848
6Jun 6, 2021 22:00150,7371,269,575,050735,611,0002,998,0002,379,776
7Jun 6, 2021 22:00151,5471,265,386,739741,579,000999,0002,510,848
8Jun 6, 2021 22:00151,6201,264,207,222741,938,000999,0002,510,848
9Jun 6, 2021 22:00154,2641,280,024,361753,893,0001,999,0002,510,848
10Jun 6, 2021 22:00162,7621,355,364,220797,532,29902,228,224
11Jun 6, 2021 22:00162,9371,354,418,889798,389,78702,236,416
12Jun 6, 2021 22:00163,8631,365,261,886802,929,11902,224,128