Блог пользователя -Cap1taL-

Автор -Cap1taL-, история, 6 месяцев назад, По-английски

https://codeforces.com/contest/1175/submission/238928196 For judging whether an array of length n is a 1~n permutation, I judged its sum{i^1} sum{i^2} sum{i^3} sum{i^4} and passed. Can anyone hack this solution or prove it correct? please help me :(

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

»
6 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

It's incorrect.

Try this:

Спойлер

Maybe it will be difficult to construct a counterexample if you compute powers up to like $$$100$$$ and do some hashing.