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:55matsuoka-601matsuoka-601Score: 63,259Success
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:5562,593334,108,011298,713,0007,992,0002,498,560
2Jun 12, 2024 06:5562,780332,730,100302,631,0004,993,0002,285,568
3Jun 12, 2024 06:5562,816328,572,866301,800,0005,996,0002,494,464
4Jun 12, 2024 06:5562,940334,397,969302,398,0006,007,0002,473,984
5Jun 12, 2024 06:5562,951335,644,952300,475,0007,986,0002,433,024
6Jun 12, 2024 06:5563,227337,680,247302,818,0006,995,0002,473,984
7Jun 12, 2024 06:5563,259333,554,988304,968,0004,999,0002,359,296
8Jun 12, 2024 06:5563,540382,612,204311,346,89202,252,800
9Jun 12, 2024 06:5563,632381,653,383311,794,61002,260,992
10Jun 12, 2024 06:5563,665394,532,146311,958,54902,260,992
11Jun 12, 2024 06:5564,547342,211,421311,275,0005,004,0002,359,296
12Jun 12, 2024 06:5572,657379,618,426350,017,0006,000,0002,347,008