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 11:38Hal FHal FScore: 58,781Success
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 11:3857,313345,510,384280,835,42902,269,184
2Apr 27, 2024 11:3857,768354,675,579283,061,26902,277,376
3Apr 27, 2024 11:3858,680373,765,836287,533,07302,277,376
4Apr 27, 2024 11:3858,757309,579,922286,909,000999,0002,289,664
5Apr 27, 2024 11:3858,771315,509,601284,977,0002,999,0002,289,664
6Apr 27, 2024 11:3858,777309,292,398286,007,0002,000,0002,523,136
7Apr 27, 2024 11:3858,781311,651,344285,025,0003,000,0002,523,136
8Apr 27, 2024 11:3858,782310,930,760285,030,0003,000,0002,531,328
9Apr 27, 2024 11:3858,804314,545,514286,138,0002,000,0002,289,664
10Apr 27, 2024 11:3858,860310,551,608286,411,0002,002,0002,510,848
11Apr 27, 2024 11:3858,916315,123,749285,694,0002,996,0002,289,664
12Apr 27, 2024 11:3858,966313,580,427285,935,0002,999,0002,289,664