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 listMay 3, 2024 18:22Hal FHal FScore: 72,999Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 3, 2024 18:2271,181411,439,258348,787,23502,273,280
2May 3, 2024 18:2271,396409,046,926349,839,38302,273,280
3May 3, 2024 18:2271,574427,668,279350,712,66802,277,376
4May 3, 2024 18:2272,426383,272,665351,887,0002,999,0002,281,472
5May 3, 2024 18:2272,611381,141,060353,797,0001,998,0002,265,088
6May 3, 2024 18:2272,942388,665,903355,412,0002,002,0002,289,664
7May 3, 2024 18:2272,999385,235,187355,696,0001,998,0002,523,136
8May 3, 2024 18:2273,008384,159,155354,741,0002,997,0002,289,664
9May 3, 2024 18:2273,026383,217,622354,831,0002,998,0002,281,472
10May 3, 2024 18:2273,133385,347,227355,358,0002,994,0002,289,664
11May 3, 2024 18:2273,200381,982,964355,684,0002,997,0002,289,664
12May 3, 2024 18:2274,438387,916,710361,750,0002,997,0002,523,136