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 18, 2023 21:14LiamLiamScore: 1,053,263Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 19, 2023 21:041,053,0075,220,451,0895,159,733,66202,252,800
2Feb 19, 2023 21:041,053,0465,225,867,4405,159,924,98802,260,992
3Feb 18, 2023 21:141,053,1075,229,307,6535,160,222,17602,265,088
4Feb 18, 2023 21:141,053,2635,226,030,3665,160,986,66402,273,280
5Feb 18, 2023 21:141,053,2785,225,804,6775,161,061,19302,273,280
6Feb 19, 2023 21:041,053,3115,220,575,8045,161,225,18002,269,184