How does Counting Inversions work in the following code?

Правка en1, от -synx-, 2017-02-24 18:52:56
a = 0
while max(V) > 0:
    C = [ 0 ] * max(V)
    for x in V:
        if x%2==0:
            a += C[x//2]
        else:
            C[x//2] += 1
    V = [ x//2 for x in V ]
print(a)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский -synx- 2017-02-24 18:52:56 267 Initial revision (published)