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

1 | tourist | 3509 |

2 | OO0OOO00O0OOO0O0…O | 3327 |

3 | Syloviaely | 3274 |

4 | Um_nik | 3237 |

5 | Petr | 3161 |

6 | fjzzq2002 | 3137 |

7 | LHiC | 3135 |

8 | Benq | 3130 |

9 | ko_osaga | 3115 |

10 | Swistakk | 3089 |

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

1 | Radewoosh | 185 |

2 | rng_58 | 161 |

3 | tourist | 158 |

4 | Petr | 152 |

5 | Vovuh | 150 |

5 | Swistakk | 150 |

7 | PikMike | 147 |

8 | csacademy | 146 |

9 | Errichto | 145 |

9 | Um_nik | 145 |

↑

↓

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/24/2018 17:35:22 (d3).

Desktop version, switch to mobile version.

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!