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 13:22Hal FHal FScore: 57,296Success
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 13:2255,708335,505,902272,967,04002,285,568
2Apr 27, 2024 13:2255,839326,596,764273,611,62702,277,376
3Apr 27, 2024 13:2256,137342,865,815275,071,11202,281,472
4Apr 27, 2024 13:2256,997304,147,631276,284,0003,003,0002,289,664
5Apr 27, 2024 13:2257,018306,959,930277,384,0002,002,0002,289,664
6Apr 27, 2024 13:2257,088308,097,661276,733,0002,997,0002,269,184
7Apr 27, 2024 13:2257,296308,224,204277,753,0002,997,0002,269,184
8Apr 27, 2024 13:2257,760309,899,122281,025,0002,000,0002,289,664
9Apr 27, 2024 13:2257,782308,963,223280,130,0003,001,0002,289,664
10Apr 27, 2024 13:2257,799304,107,032280,212,0003,002,0002,289,664
11Apr 27, 2024 13:2257,806305,524,908280,248,0003,002,0002,523,136
12Apr 27, 2024 13:2258,211307,405,657282,233,0003,002,0002,289,664