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 07:53matsuoka-601matsuoka-601Score: 64,380Success
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 07:5363,544386,970,644311,366,39402,277,376
2Jun 12, 2024 07:5363,547378,388,502311,379,30102,269,184
3Jun 12, 2024 07:5363,588389,908,474311,579,13202,277,376
4Jun 12, 2024 07:5364,166344,015,070312,411,0002,002,0002,412,544
5Jun 12, 2024 07:5364,222337,125,337311,693,0002,997,0002,416,640
6Jun 12, 2024 07:5364,245338,617,459311,804,0002,998,0002,437,120
7Jun 12, 2024 07:5364,380341,345,172313,460,0002,002,0002,285,568
8Jun 12, 2024 07:5364,390342,378,743312,515,0002,995,0002,281,472
9Jun 12, 2024 07:5364,494336,883,657314,022,0002,000,0002,285,568
10Jun 12, 2024 07:5364,675338,480,813313,910,0002,999,0002,420,736
11Jun 12, 2024 07:5364,680341,633,452313,933,0002,999,0002,281,472
12Jun 12, 2024 07:5364,682339,415,825314,943,0001,999,0002,412,544