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 12:45Hal FHal FScore: 58,650Success
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 12:4553,833347,109,503263,779,67102,269,184
2Apr 27, 2024 12:4553,833329,269,433263,783,93902,285,568
3Apr 27, 2024 12:4554,513335,953,169267,113,63702,277,376
4Apr 27, 2024 12:4558,625309,599,852285,262,0002,001,0002,527,232
5Apr 27, 2024 12:4558,626309,575,920285,268,0002,001,0002,289,664
6Apr 27, 2024 12:4558,644314,910,319285,356,0002,002,0002,523,136
7Apr 27, 2024 12:4558,650316,808,805285,383,0002,002,0002,289,664
8Apr 27, 2024 12:4558,650318,110,500285,383,0002,002,0002,289,664
9Apr 27, 2024 12:4559,194319,186,244287,051,0003,000,0002,269,184
10Apr 27, 2024 12:4559,228314,651,353287,214,0003,002,0002,523,136
11Apr 27, 2024 12:4559,366315,273,367287,894,0002,998,0002,289,664
12Apr 27, 2024 12:4560,165318,438,308291,812,0002,998,0002,510,848