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 listJun 12, 2024 13:54matsuoka-601matsuoka-601Score: 59,556Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 12, 2024 13:5459,200349,528,914290,081,93402,285,568
2Jun 12, 2024 13:5459,209356,996,242290,123,48802,293,760
3Jun 12, 2024 13:5459,276348,588,718290,449,95002,289,664
4Jun 12, 2024 13:5459,528312,951,394288,689,0002,996,0002,531,328
5Jun 12, 2024 13:5459,536316,279,706289,729,0001,998,0002,428,928
6Jun 12, 2024 13:5459,552311,871,467289,807,0001,998,0002,428,928
7Jun 12, 2024 13:5459,556319,337,888289,827,0001,998,0002,416,640
8Jun 12, 2024 13:5459,827315,432,213291,151,0002,001,0002,412,544
9Jun 12, 2024 13:5459,834325,398,891291,186,0002,001,0002,461,696
10Jun 12, 2024 13:5459,843321,272,054291,228,0002,001,0002,420,736
11Jun 12, 2024 13:5460,087326,414,857292,422,0002,002,0002,293,760
12Jun 12, 2024 13:5475,103390,782,082365,007,0003,000,0002,293,760