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 28, 2024 21:19Hal FHal FScore: 54,440Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2024 21:1953,592325,007,180262,600,92202,277,376
2Apr 28, 2024 21:1953,622320,307,720262,747,45102,281,472
3Apr 28, 2024 21:1953,910289,129,049262,157,0002,001,0002,527,232
4Apr 28, 2024 21:1954,076289,229,641262,971,0001,999,0002,289,664
5Apr 28, 2024 21:1954,247293,102,222262,813,0002,997,0002,289,664
6Apr 28, 2024 21:1954,299292,704,329263,066,0003,000,0002,265,088
7Apr 28, 2024 21:1954,440293,351,883264,759,0001,998,0002,289,664
8Apr 28, 2024 21:1954,521294,663,029264,152,0003,001,0002,265,088
9Apr 28, 2024 21:1954,619293,901,754264,639,0002,995,0002,527,232
10Apr 28, 2024 21:1954,634293,927,464264,709,0002,996,0002,523,136
11Apr 28, 2024 21:1954,999296,415,362267,500,0001,996,0002,289,664
12Apr 28, 2024 21:1956,304333,743,878275,887,26402,281,472