# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
Name |
---|
Nobody??? Not even an opinion.....
It's proved, years don't pass along your mind :) After 3 years, you take a look at the problem again, think of it about 15 minutes, and you get a new optimization that solves it :) In this case that the longest meaningful code must be less than the length of the message :) solution
First of all, thank you kindly for source code with solution! However, I am a bit confused with 1 particular moment: why in the solution it is ok to pick n starting from m/2? How is that possible that it provides correct result if half of possible keys are ignored? Thanks in advance!
If a key of length k is valid, then that key squared (of length 2 * k) is valid too, so we only need to check key lengths that can't be squared, aka starting from m / 2.