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 14, 2024 06:18matsuoka-601matsuoka-601Score: 56,552Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 14, 2024 06:1855,336339,083,437271,145,04802,269,184
2Jun 14, 2024 06:1855,352340,728,046271,225,67302,273,280
3Jun 14, 2024 06:1855,369334,806,171271,309,75702,269,184
4Jun 14, 2024 06:1856,536304,474,406275,024,0002,000,0002,293,760
5Jun 14, 2024 06:1856,550302,950,850274,095,0003,001,0002,293,760
6Jun 14, 2024 06:1856,551300,641,201275,101,0002,000,0002,293,760
7Jun 14, 2024 06:1856,552298,489,604274,102,0003,001,0002,428,928
8Jun 14, 2024 06:1856,567299,143,098275,175,0002,001,0002,293,760
9Jun 14, 2024 06:1856,571305,717,542275,199,0002,001,0002,441,216
10Jun 14, 2024 06:1856,840315,704,547275,523,0002,994,0002,293,760
11Jun 14, 2024 06:1856,975301,576,826277,176,0002,001,0002,424,832
12Jun 14, 2024 06:1857,161304,682,797278,088,0002,000,0002,293,760