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 listAug 1, 2024 23:23Andrey LikhachevAndrey LikhachevScore: 155,109Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 1, 2024 23:23154,991786,385,014758,458,000999,0002,363,392
2Aug 1, 2024 23:23155,022795,666,583757,608,0001,998,0002,363,392
3Aug 1, 2024 23:23155,041784,478,997758,703,000999,0002,359,296
4Aug 1, 2024 23:23155,046788,521,699757,728,0001,999,0002,293,760
5Aug 1, 2024 23:23155,060787,850,703757,796,0001,999,0002,293,760
6Aug 1, 2024 23:23155,087787,174,776757,928,0001,999,0002,293,760
7Aug 1, 2024 23:23155,109785,353,320759,035,0001,000,0002,363,392
8Aug 1, 2024 23:23155,176795,501,633759,361,000999,0002,293,760
9Aug 1, 2024 23:23155,247790,655,104759,711,000999,0002,293,760
10Aug 1, 2024 23:23155,850834,545,960763,665,26002,203,648
11Aug 1, 2024 23:23155,894823,210,027763,878,96102,207,744
12Aug 1, 2024 23:23164,957873,288,577808,289,89602,203,648