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 15:14matsuoka-601matsuoka-601Score: 59,810Success
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 15:1459,222320,601,444289,189,0001,000,0002,293,760
2Jun 12, 2024 15:1459,296317,335,907289,549,0001,001,0002,293,760
3Jun 12, 2024 15:1459,432363,419,264291,215,89402,273,280
4Jun 12, 2024 15:1459,525385,967,883291,673,07402,273,280
5Jun 12, 2024 15:1459,704318,805,479290,547,0002,003,0002,293,760
6Jun 12, 2024 15:1459,739317,418,668289,724,0002,997,0002,416,640
7Jun 12, 2024 15:1459,810316,187,244290,068,0003,000,0002,293,760
8Jun 12, 2024 15:1459,813313,087,174290,085,0003,000,0002,416,640
9Jun 12, 2024 15:1459,824315,302,197291,137,0002,000,0002,428,928
10Jun 12, 2024 15:1460,579324,993,299293,838,0002,998,0002,420,736
11Jun 12, 2024 15:1461,002367,450,106298,908,36902,285,568
12Jun 12, 2024 15:1463,269332,628,492308,020,0002,000,0002,416,640