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 listJul 30, 2022 10:38Robert BurkeRobert BurkeScore: 64,674Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 30, 2022 10:3863,674392,543,914312,002,69802,183,168
2Jul 30, 2022 10:3863,680381,596,005312,030,57602,260,992
3Jul 30, 2022 10:3864,186389,576,807314,512,95902,260,992
4Jul 30, 2022 10:3864,628342,972,398315,680,000998,0002,281,472
5Jul 30, 2022 10:3864,639343,333,188314,733,0001,998,0002,281,472
6Jul 30, 2022 10:3864,640344,797,536314,737,0001,998,0002,441,216
7Jul 30, 2022 10:3864,674343,505,417314,903,0001,999,0002,281,472
8Jul 30, 2022 10:3864,687341,186,564314,969,0001,999,0002,281,472
9Jul 30, 2022 10:3864,710338,810,885315,078,0002,000,0002,281,472
10Jul 30, 2022 10:3864,951342,056,639317,259,0001,000,0002,281,472
11Jul 30, 2022 10:3864,976336,494,846317,380,0001,001,0002,441,216
12Jul 30, 2022 10:3865,111339,186,171317,043,0002,000,0002,281,472