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 14, 2024 13:44matsuoka-601matsuoka-601Score: 55,906Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 14, 2024 13:4454,186319,838,793265,510,42102,277,376
2Jun 14, 2024 13:4455,847302,360,381271,652,0001,997,0002,293,760
3Jun 14, 2024 13:4455,866302,252,177271,744,0001,998,0002,293,760
4Jun 14, 2024 13:4455,867341,023,637273,748,61502,273,280
5Jun 14, 2024 13:4455,874297,555,150270,785,0002,997,0002,441,216
6Jun 14, 2024 13:4455,902328,753,975273,919,84302,273,280
7Jun 14, 2024 13:4455,906302,535,783270,940,0002,999,0002,293,760
8Jun 14, 2024 13:4455,936297,155,138271,087,0003,000,0002,424,832
9Jun 14, 2024 13:4455,979299,161,794271,295,0003,003,0002,293,760
10Jun 14, 2024 13:4456,455309,152,738274,631,0001,997,0002,441,216
11Jun 14, 2024 13:4456,710305,827,994275,878,0001,999,0002,293,760
12Jun 14, 2024 13:4458,759310,462,562284,920,0002,999,0002,416,640