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 06:54matsuoka-601matsuoka-601Score: 62,952Success
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 06:5462,338331,856,148300,449,0005,007,0002,392,064
2Jun 12, 2024 06:5462,345335,329,149298,481,0007,011,0002,510,848
3Jun 12, 2024 06:5462,377334,360,948297,659,0007,990,0002,527,232
4Jun 12, 2024 06:5462,475327,355,235299,126,0007,002,0002,469,888
5Jun 12, 2024 06:5462,514331,768,832300,311,0006,006,0002,478,080
6Jun 12, 2024 06:5462,684330,660,171302,148,0005,002,0002,383,872
7Jun 12, 2024 06:5462,952338,664,819299,483,0008,984,0002,494,464
8Jun 12, 2024 06:5463,044332,473,322304,920,0003,998,0002,433,024
9Jun 12, 2024 06:5464,553387,299,730316,307,37602,265,088
10Jun 12, 2024 06:5464,636382,666,020316,718,04702,265,088
11Jun 12, 2024 06:5464,745373,948,165317,249,50902,256,896
12Jun 12, 2024 06:5465,033348,442,594308,674,0009,989,0002,469,888