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:28matsuoka-601matsuoka-601Score: 54,081Success
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:2853,635294,002,628259,815,0002,997,0002,293,760
2Jun 14, 2024 06:2853,662290,263,138259,945,0002,999,0002,510,848
3Jun 14, 2024 06:2853,664290,551,560259,953,0002,999,0002,293,760
4Jun 14, 2024 06:2853,664285,472,470259,954,0002,999,0002,293,760
5Jun 14, 2024 06:2853,674285,871,634260,005,0003,000,0002,498,560
6Jun 14, 2024 06:2853,851289,290,961262,869,000999,0002,293,760
7Jun 14, 2024 06:2854,081288,309,636261,997,0002,999,0002,424,832
8Jun 14, 2024 06:2854,967294,006,144267,335,0002,002,0002,416,640
9Jun 14, 2024 06:2855,877340,320,697273,799,10402,256,896
10Jun 14, 2024 06:2856,110346,339,992274,939,08102,289,664
11Jun 14, 2024 06:2856,461338,215,668276,657,58202,281,472
12Jun 14, 2024 06:2868,335360,619,072331,842,0002,998,0002,293,760