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 14:59Huy Duc LeHuy Duc LeScore: 141,173Success
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 14:59138,957705,558,409678,892,0001,999,0002,527,232
2Feb 20, 2024 14:59139,018705,753,772679,189,0002,000,0002,527,232
3Feb 20, 2024 14:59139,049712,149,153681,341,00002,277,376
4Feb 20, 2024 14:59139,077705,990,437679,479,0001,998,0002,379,776
5Feb 20, 2024 14:59139,101703,306,568677,597,0003,997,0002,519,040
6Feb 20, 2024 14:59139,483709,003,547681,471,0001,998,0002,277,376
7Feb 20, 2024 14:59141,173713,773,189688,752,0002,998,0002,277,376
8Feb 20, 2024 14:59141,411715,853,924690,913,0001,999,0002,527,232
9Feb 20, 2024 14:59141,914715,550,908692,381,0002,997,0002,277,376
10Feb 20, 2024 14:59160,866856,527,936788,241,37202,277,376
11Feb 20, 2024 14:59161,008847,844,967788,940,64102,277,376
12Feb 20, 2024 14:59161,433860,332,655791,020,24102,277,376