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 20:30Hal FHal FScore: 62,861Success
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 20:3060,447367,157,126296,191,75702,273,280
2Apr 25, 2024 20:3060,517361,891,637296,535,30902,252,800
3Apr 25, 2024 20:3061,732361,121,162302,487,93102,273,280
4Apr 25, 2024 20:3062,787331,231,113304,659,0002,996,0002,375,680
5Apr 25, 2024 20:3062,841335,129,267304,921,0002,999,0002,285,568
6Apr 25, 2024 20:3062,847331,483,630305,953,0001,999,0002,285,568
7Apr 25, 2024 20:3062,861337,051,986305,018,0003,000,0002,285,568
8Apr 25, 2024 20:3062,897330,430,049306,193,0002,001,0002,285,568
9Apr 25, 2024 20:3062,904338,061,722306,229,0002,001,0002,281,472
10Apr 25, 2024 20:3064,473337,489,918313,919,0001,999,0002,514,944
11Apr 25, 2024 20:3065,648350,621,084318,677,0002,996,0002,527,232
12Apr 25, 2024 20:3065,653349,776,652318,704,0002,997,0002,273,280