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 25, 2024 22:49Hal FHal FScore: 55,008Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 25, 2024 22:4954,345331,008,103266,290,43802,273,280
2Apr 25, 2024 22:4954,456329,888,424266,833,63502,277,376
3Apr 25, 2024 22:4954,489340,070,046266,996,11702,273,280
4Apr 25, 2024 22:4954,919300,612,720266,104,0003,001,0002,289,664
5Apr 25, 2024 22:4954,990294,104,797267,457,0001,995,0002,289,664
6Apr 25, 2024 22:4954,998296,894,262268,489,0001,001,0002,273,280
7Apr 25, 2024 22:4955,008295,091,609267,534,0002,004,0002,289,664
8Apr 25, 2024 22:4955,085299,202,162266,918,0002,999,0002,289,664
9Apr 25, 2024 22:4955,477298,526,039268,841,0002,998,0002,273,280
10Apr 25, 2024 22:4955,977303,605,412272,286,0002,002,0002,527,232
11Apr 25, 2024 22:49102,622530,775,224500,849,0001,999,0002,289,664
12Apr 25, 2024 22:49102,657531,561,811501,019,0002,000,0002,289,664