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 16, 2024 06:24Andrey LikhachevAndrey LikhachevScore: 155,143Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 16, 2024 06:24155,001787,818,518758,506,000999,0002,293,760
2Aug 16, 2024 06:24155,064789,073,588757,815,0001,999,0002,359,296
3Aug 16, 2024 06:24155,068787,330,355759,833,00002,293,760
4Aug 16, 2024 06:24155,069784,173,339758,840,000999,0002,293,760
5Aug 16, 2024 06:24155,109784,946,729758,033,0002,000,0002,293,760
6Aug 16, 2024 06:24155,132783,266,752759,148,0001,000,0002,363,392
7Aug 16, 2024 06:24155,143786,407,430759,200,0001,000,0002,355,200
8Aug 16, 2024 06:24155,150791,241,681758,239,0001,997,0002,461,696
9Aug 16, 2024 06:24155,202790,522,789758,492,0001,998,0002,293,760
10Aug 16, 2024 06:24155,769824,201,146763,268,30802,199,552
11Aug 16, 2024 06:24155,879832,929,696763,806,22502,203,648
12Aug 16, 2024 06:24155,951845,283,051764,158,47102,330,624