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:53matsuoka-601matsuoka-601Score: 59,613Success
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:5359,270355,597,143290,424,18102,289,664
2Jun 12, 2024 13:5359,337360,875,943290,752,95602,289,664
3Jun 12, 2024 13:5359,413355,245,690291,122,02202,281,472
4Jun 12, 2024 13:5359,562315,108,703288,856,0002,998,0002,441,216
5Jun 12, 2024 13:5359,572316,127,456289,904,0001,999,0002,293,760
6Jun 12, 2024 13:5359,586315,009,730288,971,0002,999,0002,412,544
7Jun 12, 2024 13:5359,613319,065,240290,106,0002,000,0002,293,760
8Jun 12, 2024 13:5359,618320,204,514290,127,0002,000,0002,293,760
9Jun 12, 2024 13:5361,000324,399,960296,899,0001,999,0002,293,760
10Jun 12, 2024 13:5361,842327,169,786301,025,0002,000,0002,412,544
11Jun 12, 2024 13:5363,215333,993,896306,756,0002,997,0002,293,760
12Jun 12, 2024 13:5370,966371,768,519344,735,0002,997,0002,293,760