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 listDec 17, 2023 08:47Kenneth MaplesKenneth MaplesScore: 175,936Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 17, 2023 08:47174,851920,903,665856,770,59102,269,184
2Dec 17, 2023 08:45175,188923,758,942858,419,85802,269,184
3Dec 17, 2023 08:45175,192918,317,754858,442,48702,265,088
4Dec 17, 2023 08:47175,936925,419,816862,085,50802,269,184
5Dec 17, 2023 08:47177,557926,771,765870,028,56102,273,280
6Dec 17, 2023 08:45177,959952,505,870872,000,16802,265,088