INFINITE INVERSIONS

Правка en1, от vsanjay_nitdgp, 2015-10-13 21:27:38

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.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский vsanjay_nitdgp 2015-10-13 21:27:38 570 Initial revision (published)