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 09:18matsuoka-601matsuoka-601Score: 60,944Success
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 09:1759,750315,372,279289,779,0002,997,0002,416,640
2Jun 12, 2024 09:1759,767319,593,603290,857,0001,999,0002,424,832
3Jun 12, 2024 09:1860,479318,326,467295,344,0001,001,0002,293,760
4Jun 12, 2024 09:1760,534326,461,939293,620,0002,996,0002,424,832
5Jun 12, 2024 09:1860,629319,902,216294,080,0003,000,0002,293,760
6Jun 12, 2024 09:1760,631319,838,047295,090,0002,000,0002,428,928
7Jun 12, 2024 09:1760,639320,158,764294,132,0003,001,0002,293,760
8Jun 12, 2024 09:1760,649321,410,850296,179,0001,000,0002,412,544
9Jun 12, 2024 09:1860,807320,816,880294,956,0002,999,0002,498,560
10Jun 12, 2024 09:1860,839351,990,880298,109,13702,289,664
11Jun 12, 2024 09:1760,848364,051,890298,156,76602,277,376
12Jun 12, 2024 09:1760,861362,204,369298,218,78902,277,376
13Jun 12, 2024 09:1760,944377,363,660298,627,18902,273,280
14Jun 12, 2024 09:1861,089368,769,967299,335,28702,277,376
15Jun 12, 2024 09:1861,429326,287,186298,002,0003,000,0002,293,760
16Jun 12, 2024 09:1862,335362,933,328305,439,25402,277,376
17Jun 12, 2024 09:1762,376332,294,591303,647,0001,997,0002,424,832
18Jun 12, 2024 09:1862,423327,192,365303,873,0001,999,0002,424,832
19Jun 12, 2024 09:1862,430333,773,917303,906,0001,999,0002,293,760
20Jun 12, 2024 09:1763,631336,757,645308,795,0002,998,0002,420,736
21Jun 12, 2024 09:1872,454377,801,735353,027,0002,000,0002,412,544
22Jun 12, 2024 09:1876,217400,436,589371,462,0002,002,0002,437,120
23Jun 12, 2024 09:1781,410420,531,297395,908,0002,999,0002,293,760
24Jun 12, 2024 09:1881,644427,176,937397,054,0003,000,0002,293,760