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 04:53matsuoka-601matsuoka-601Score: 62,247Success
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 04:5361,095323,849,474297,362,0002,002,0002,281,472
2Jun 12, 2024 04:5361,110325,793,103298,439,0001,001,0002,281,472
3Jun 12, 2024 04:5361,172322,673,808296,746,0002,997,0002,277,376
4Jun 12, 2024 04:5361,236322,317,799297,054,0003,000,0002,269,184
5Jun 12, 2024 04:5361,480325,759,027299,252,0002,001,0002,527,232
6Jun 12, 2024 04:5361,494323,031,967299,320,0002,002,0002,269,184
7Jun 12, 2024 04:5362,247334,946,488302,011,0003,000,0002,285,568
8Jun 12, 2024 04:5364,066338,868,340311,924,0001,999,0002,269,184
9Jun 12, 2024 04:5366,119384,130,113323,984,93702,269,184
10Jun 12, 2024 04:5366,395392,085,053325,337,85102,273,280
11Jun 12, 2024 04:5366,630398,346,889326,487,02502,273,280
12Jun 12, 2024 04:5367,905361,702,649329,736,0002,997,0002,523,136