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 listMay 2, 2024 20:04Hal FHal FScore: 58,167Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 2, 2024 20:0457,343351,464,120280,982,39602,273,280
2May 2, 2024 20:0457,420336,625,752281,355,87002,277,376
3May 2, 2024 20:0457,912305,403,048281,770,0001,998,0002,289,664
4May 2, 2024 20:0457,963307,804,633282,021,0002,000,0002,523,136
5May 2, 2024 20:0458,129341,355,481284,831,01102,281,472
6May 2, 2024 20:0458,132307,972,480282,851,0001,998,0002,289,664
7May 2, 2024 20:0458,167314,361,227282,016,0003,000,0002,289,664
8May 2, 2024 20:0458,170313,819,139285,034,00002,281,472
9May 2, 2024 20:0458,177314,790,401284,066,0001,000,0002,289,664
10May 2, 2024 20:0458,177310,217,444282,069,0003,000,0002,289,664
11May 2, 2024 20:0458,187310,505,461283,116,0002,000,0002,527,232
12May 2, 2024 20:0458,188307,975,902282,119,0003,001,0002,273,280