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 listAug 21, 2021 17:50Yuriy LyfenkoYuriy LyfenkoScore: 133,887Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 21, 2021 17:50122,8331,163,782,667601,882,27902,252,800
2Aug 21, 2021 17:50126,6501,191,036,828620,586,07502,240,512
3Aug 21, 2021 17:50127,2651,200,778,309623,597,04602,248,704
4Aug 21, 2021 17:50130,1821,164,793,678636,891,0001,001,0002,523,136
5Aug 21, 2021 17:50131,0621,172,229,357641,202,0001,001,0002,527,232
6Aug 21, 2021 17:50131,5721,171,462,141642,703,0002,002,0002,281,472
7Aug 21, 2021 17:50133,8871,178,759,955655,047,0001,001,0002,265,088
8Aug 21, 2021 17:50134,3431,185,580,041656,286,0001,997,0002,281,472
9Aug 21, 2021 17:50135,9451,194,304,069665,130,0001,001,0002,265,088
10Aug 21, 2021 17:50136,2961,191,004,590664,850,0002,999,0002,265,088
11Aug 21, 2021 17:50138,5511,208,310,708675,900,0002,999,0002,519,040
12Aug 21, 2021 17:50143,2881,226,491,582702,109,00002,265,088