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 15, 2024 03:19matsuoka-601matsuoka-601Score: 52,728Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 15, 2024 03:1952,557334,545,390257,531,66002,277,376
2Jun 15, 2024 03:1952,585323,850,631257,666,38302,281,472
3Jun 15, 2024 03:1952,709287,130,854257,274,0001,001,0002,293,760
4Jun 15, 2024 03:1952,710284,343,374256,278,0002,002,0002,273,280
5Jun 15, 2024 03:1952,718280,630,206256,315,0002,002,0002,293,760
6Jun 15, 2024 03:1952,720284,438,010256,325,0002,002,0002,293,760
7Jun 15, 2024 03:1952,728281,056,322257,365,0001,001,0002,293,760
8Jun 15, 2024 03:1952,749290,359,433256,466,0002,003,0002,293,760
9Jun 15, 2024 03:1952,750285,786,892256,474,0002,003,0002,293,760
10Jun 15, 2024 03:1953,356330,452,215261,443,58402,269,184
11Jun 15, 2024 03:1954,020293,451,437262,699,0001,997,0002,293,760
12Jun 15, 2024 03:1954,961294,720,016267,307,0002,002,0002,293,760