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:19matsuoka-601matsuoka-601Score: 56,581Success
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:1955,339348,024,490271,161,82702,277,376
2Jun 14, 2024 06:1955,491344,455,574271,904,90702,273,280
3Jun 14, 2024 06:1955,724328,401,646273,049,89902,277,376
4Jun 14, 2024 06:1956,565300,195,467274,168,0003,001,0002,424,832
5Jun 14, 2024 06:1956,569304,447,283275,187,0002,001,0002,420,736
6Jun 14, 2024 06:1956,573303,661,406274,208,0003,002,0002,293,760
7Jun 14, 2024 06:1956,581300,478,094274,246,0003,002,0002,424,832
8Jun 14, 2024 06:1956,706301,537,339274,862,0002,998,0002,293,760
9Jun 14, 2024 06:1956,841305,165,474277,520,0001,001,0002,293,760
10Jun 14, 2024 06:1957,086310,584,476277,725,0001,998,0002,420,736
11Jun 14, 2024 06:1957,131304,926,205277,945,0001,999,0002,420,736
12Jun 14, 2024 06:1957,971311,755,354282,056,0002,000,0002,412,544