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 13:21matsuoka-601matsuoka-601Score: 54,976Success
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 13:2154,485335,102,024266,978,32802,269,184
2Jun 14, 2024 13:2154,516292,210,154264,127,0003,001,0002,441,216
3Jun 14, 2024 13:2154,537294,382,908264,227,0003,002,0002,293,760
4Jun 14, 2024 13:2154,541293,024,757264,250,0003,002,0002,293,760
5Jun 14, 2024 13:2154,607291,149,756264,581,0002,995,0002,416,640
6Jun 14, 2024 13:2154,619351,688,632267,635,29802,277,376
7Jun 14, 2024 13:2154,976292,574,420267,378,0002,002,0002,433,024
8Jun 14, 2024 13:2154,989293,971,687267,445,0002,003,0002,441,216
9Jun 14, 2024 13:2155,076293,010,964266,874,0002,998,0002,416,640
10Jun 14, 2024 13:2155,091300,486,531266,945,0002,999,0002,293,760
11Jun 14, 2024 13:2156,266302,598,557273,705,0001,997,0002,293,760
12Jun 14, 2024 13:2157,013359,225,936279,363,56102,273,280