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 6, 2025 09:45Oleg KovalovOleg KovalovScore: 583,743Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 6, 2025 09:45583,6612,883,923,6352,858,941,000999,0002,424,832
2Feb 6, 2025 09:45583,6812,889,192,1672,859,039,000999,0002,269,184
3Feb 6, 2025 09:45583,6962,883,959,5962,858,114,0001,998,0002,428,928
4Feb 6, 2025 09:45583,6982,889,653,9832,859,119,000999,0002,269,184
5Feb 6, 2025 09:45583,7432,888,438,9112,859,342,000999,0002,531,328
6Feb 6, 2025 09:45583,7522,891,014,8772,860,384,00002,428,928
7Feb 6, 2025 09:45583,7572,884,806,4202,859,411,000999,0002,428,928
8Feb 6, 2025 09:45583,7802,888,342,7402,860,524,00002,269,184
9Feb 6, 2025 09:45583,9042,885,975,1052,859,133,0001,998,0002,433,024