Can anyone explain solution for Permutation Game?

Правка en1, от ganesh_6, 2021-12-12 18:28:41

I am solving the problem https://mirror.codeforces.com/problemset/problem/1033/C. I could not get the editorial and found the comment https://mirror.codeforces.com/blog/entry/62287?#comment-462858 useful. I have implemented the solution as per the comment, but it is giving WA

WA
AC

My doubt is that why can't we do like WA and why should we loop using elements instead of indexes?

Please explain why the earlier approach is giving WA and not later.

Теги dp, help, c++, java

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ganesh_6 2021-12-12 18:28:41 3850 Initial revision (published)