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 13:45matsuoka-601matsuoka-601Score: 61,256Success
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 13:4559,807315,798,822290,052,0003,000,0002,523,136
2Jun 12, 2024 13:4559,846315,555,702292,246,0001,000,0002,293,760
3Jun 12, 2024 13:4560,225318,892,373293,103,0002,000,0002,293,760
4Jun 12, 2024 13:4560,265320,668,750293,296,0002,002,0002,416,640
5Jun 12, 2024 13:4560,363319,802,132292,783,0002,997,0002,441,216
6Jun 12, 2024 13:4560,379318,669,701292,860,0002,998,0002,293,760
7Jun 12, 2024 13:4561,256362,121,607300,152,07002,277,376
8Jun 12, 2024 13:4561,275377,287,308300,245,20402,285,568
9Jun 12, 2024 13:4561,292366,593,749300,330,60502,277,376
10Jun 12, 2024 13:4562,000331,537,968301,801,0001,998,0002,420,736
11Jun 12, 2024 13:4562,010326,640,217300,850,0002,998,0002,416,640
12Jun 12, 2024 13:4566,875358,067,281324,689,0002,997,0002,420,736