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:05Huy Duc LeHuy Duc LeScore: 159,127Success
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:05157,621800,104,552770,345,0001,998,0002,289,664
2Feb 20, 2024 15:05158,202802,786,611773,190,0002,000,0002,289,664
3Feb 20, 2024 15:05158,274797,648,844772,545,0002,998,0002,527,232
4Feb 20, 2024 15:05158,372799,656,789773,026,0002,996,0002,379,776
5Feb 20, 2024 15:05158,476803,744,036772,537,0003,997,0002,281,472
6Feb 20, 2024 15:05158,544805,072,172773,866,0002,999,0002,527,232
7Feb 20, 2024 15:05159,127867,597,505779,721,19902,281,472
8Feb 20, 2024 15:05159,538850,830,468781,737,09302,281,472
9Feb 20, 2024 15:05159,558808,149,468778,833,0002,999,0002,519,040
10Feb 20, 2024 15:05159,954810,291,542780,774,0002,999,0002,527,232
11Feb 20, 2024 15:05161,431822,088,410790,010,0001,000,0002,523,136
12Feb 20, 2024 15:05161,773856,179,029792,687,23402,269,184