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

Автор vsanjay_nitdgp, история, 9 лет назад, По-английски

Recently,i was solving the following problem: http://codeforces.me/problemset/problem/540/E

the following is the solution i am trying to understand: http://ideone.com/cKjRNr

In the last loop of solution there are two terms,1 is to find difference of initial and final position of that element.

what about second term.according to editorial ,second term is to delete the inversions that were already counted.

so,could any one help how did we get "num[i]-i" as our second term,,whats the proof behind it..

pls help,thanks in advance.

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