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 13, 2024 12:07matsuoka-601matsuoka-601Score: 59,931Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 13, 2024 12:0759,232346,888,684290,236,84402,281,472
2Jun 13, 2024 12:0759,486318,311,305289,476,0002,003,0002,416,640
3Jun 13, 2024 12:0759,492318,061,949289,507,0002,003,0002,420,736
4Jun 13, 2024 12:0759,525322,241,180289,677,0001,997,0002,293,760
5Jun 13, 2024 12:0759,526357,598,347291,675,79202,277,376
6Jun 13, 2024 12:0759,584315,251,537288,965,0002,999,0002,404,352
7Jun 13, 2024 12:0759,931324,180,034291,666,0001,997,0002,293,760
8Jun 13, 2024 12:0759,987323,388,954290,935,0002,999,0002,420,736
9Jun 13, 2024 12:0760,004319,286,536291,021,0003,000,0002,424,832
10Jun 13, 2024 12:0760,519361,747,196296,540,96002,269,184
11Jun 13, 2024 12:0761,822328,186,570299,928,0002,999,0002,293,760
12Jun 13, 2024 12:0763,728337,205,719311,267,0001,000,0002,293,760