# | User | Rating |
---|---|---|

1 | tourist | 3882 |

2 | maroonrk | 3539 |

3 | Benq | 3513 |

4 | MiracleFaFa | 3466 |

5 | ksun48 | 3462 |

6 | ecnerwala | 3446 |

7 | slime | 3428 |

8 | Um_nik | 3426 |

9 | jiangly | 3401 |

10 | greenheadstrange | 3393 |

# | User | Contrib. |
---|---|---|

1 | awoo | 192 |

2 | -is-this-fft- | 191 |

3 | Monogon | 184 |

4 | YouKn0wWho | 182 |

4 | Um_nik | 182 |

6 | antontrygubO_o | 171 |

7 | maroonrk | 169 |

8 | kostka | 165 |

9 | SecondThread | 164 |

9 | errorgorn | 164 |

↑

↓

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/24/2022 22:22:21 (h3).

Desktop version, switch to mobile version.

Supported by

User lists

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.

gilcu3, thanks!