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 listFeb 5, 2025 13:10Oleg KovalovOleg KovalovScore: 2,192,080Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 5, 2025 13:102,189,60610,764,694,59510,717,078,00011,990,0002,404,352
2Feb 5, 2025 13:102,189,69110,765,728,82910,716,499,00012,989,0002,473,984
3Feb 5, 2025 13:102,189,94410,766,819,98610,718,738,00011,989,0002,473,984
4Feb 5, 2025 13:102,190,90210,773,448,27510,722,429,00012,989,0002,371,584
5Feb 5, 2025 13:102,192,08010,772,691,15610,733,196,0007,994,0002,289,664
6Feb 5, 2025 13:102,192,19110,778,074,81910,730,744,00010,991,0002,314,240
7Feb 5, 2025 13:102,193,10610,782,474,08410,739,223,0006,994,0002,437,120
8Feb 5, 2025 13:102,193,54310,785,100,70310,736,373,00011,988,0002,400,256
9Feb 5, 2025 13:102,196,61010,797,800,56910,751,400,00011,990,0002,543,616