fork download
  1. # your code goes here
  2. def InversionCount(a,n):
  3. count = 0
  4. for i in range(len(a)):
  5. for j in range(i+1,len(a)):
  6. if a[i]>a[j]:
  7. count+=1
  8. return count
  9. a = list(map(int,input().split()))
  10. print(InversionCount(a,len(a)))
  11.  
  12.  
Success #stdin #stdout 0.09s 14164KB
stdin
5 5 5 5 5 5
stdout
0