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 19, 2023 21:22LiamLiamScore: 1,046,732Success
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:291,046,4095,193,378,2785,127,405,14602,265,088
2Feb 19, 2023 21:291,046,4115,193,935,4285,127,414,32402,260,992
3Feb 19, 2023 21:271,046,5195,197,075,9425,127,940,75402,260,992
4Feb 19, 2023 21:271,046,6245,197,261,7265,128,455,88202,269,184
5Feb 19, 2023 21:221,046,6375,192,730,9555,128,521,23902,269,184
6Feb 19, 2023 21:221,046,6425,199,274,1495,128,546,88602,269,184
7Feb 19, 2023 21:221,046,7325,198,619,5075,128,987,25302,269,184
8Feb 19, 2023 21:221,046,8545,189,008,9055,129,584,77402,273,280
9Feb 19, 2023 21:221,046,9275,186,228,4185,129,942,33002,281,472
10Feb 19, 2023 21:221,047,3715,193,825,3265,132,115,84602,260,992
11Feb 19, 2023 21:291,047,5415,204,983,7865,132,948,94802,256,896
12Feb 19, 2023 21:271,047,8715,198,962,6855,134,569,38602,265,088