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 20, 2024 15:01Huy Duc LeHuy Duc LeScore: 159,089Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 20, 2024 15:01156,911801,515,893766,867,0001,999,0002,277,376
2Feb 20, 2024 15:01157,298792,464,168768,761,0001,999,0002,281,472
3Feb 20, 2024 15:01158,165802,876,670773,007,0002,000,0002,555,904
4Feb 20, 2024 15:01158,300803,633,394773,672,0001,999,0002,277,376
5Feb 20, 2024 15:01158,328797,939,099773,806,0001,999,0002,527,232
6Feb 20, 2024 15:01158,471801,013,513774,511,0001,998,0002,277,376
7Feb 20, 2024 15:01159,089803,196,563775,540,0003,997,0002,527,232
8Feb 20, 2024 15:01159,506837,037,644781,581,57102,269,184
9Feb 20, 2024 15:01160,528810,545,214784,589,0001,998,0002,277,376
10Feb 20, 2024 15:01160,853818,457,211786,180,0002,000,0002,535,424
11Feb 20, 2024 15:01160,897851,286,730788,394,13402,281,472
12Feb 20, 2024 15:01161,358866,406,531790,652,73202,281,472