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:01Hal FHal FScore: 56,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:0155,754339,933,084273,193,21002,281,472
2Apr 27, 2024 19:0156,015301,282,582273,473,0001,001,0002,269,184
3Apr 27, 2024 19:0156,058303,714,936272,689,0001,997,0002,289,664
4Apr 27, 2024 19:0156,063304,022,634271,711,0002,996,0002,289,664
5Apr 27, 2024 19:0156,066300,931,919271,726,0002,996,0002,289,664
6Apr 27, 2024 19:0156,087297,306,524271,829,0002,998,0002,289,664
7Apr 27, 2024 19:0156,381341,915,723276,265,25102,277,376
8Apr 27, 2024 19:0156,457339,045,201276,638,90302,289,664
9Apr 27, 2024 19:0157,226304,040,099278,403,0002,002,0002,289,664
10Apr 27, 2024 19:0157,290303,067,360277,724,0002,997,0002,523,136
11Apr 27, 2024 19:0157,360303,339,742278,062,0003,000,0002,531,328
12Apr 27, 2024 19:0157,476308,368,904279,637,0001,997,0002,289,664