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:42matsuoka-601matsuoka-601Score: 55,737Success
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:4255,393298,260,941270,427,0001,001,0002,424,832
2Jun 14, 2024 13:4255,443297,833,531269,676,0001,997,0002,293,760
3Jun 14, 2024 13:4255,460300,706,377268,757,0002,997,0002,293,760
4Jun 14, 2024 13:4255,462299,823,975268,767,0002,997,0002,293,760
5Jun 14, 2024 13:4255,607300,818,565270,473,0002,003,0002,428,928
6Jun 14, 2024 13:4255,654298,314,973271,707,000998,0002,420,736
7Jun 14, 2024 13:4255,737299,934,444270,112,0003,001,0002,420,736
8Jun 14, 2024 13:4255,770301,399,426272,273,0001,001,0002,412,544
9Jun 14, 2024 13:4255,782327,842,706273,333,17802,281,472
10Jun 14, 2024 13:4255,885342,571,712273,838,10702,277,376
11Jun 14, 2024 13:4256,694339,882,479277,802,51802,281,472
12Jun 14, 2024 13:4256,771303,130,886276,176,0002,001,0002,293,760