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 listApr 27, 2024 19:05Hal FHal FScore: 53,381Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 19:0552,966321,903,664259,531,47002,269,184
2Apr 27, 2024 19:0553,213284,126,522257,749,0002,997,0002,289,664
3Apr 27, 2024 19:0553,232287,059,569257,839,0002,998,0002,359,296
4Apr 27, 2024 19:0553,267290,212,102259,007,0002,000,0002,289,664
5Apr 27, 2024 19:0553,267288,914,787259,010,0002,000,0002,523,136
6Apr 27, 2024 19:0553,273284,370,143258,036,0003,000,0002,289,664
7Apr 27, 2024 19:0553,381330,928,742261,566,85302,289,664
8Apr 27, 2024 19:0553,652285,320,945259,896,0002,998,0002,289,664
9Apr 27, 2024 19:0553,735339,736,868263,302,64202,285,568
10Apr 27, 2024 19:0553,808289,687,034261,660,0001,997,0002,269,184
11Apr 27, 2024 19:0553,817287,314,525260,706,0002,996,0002,289,664
12Apr 27, 2024 19:0554,001286,492,225261,609,0002,995,0002,289,664