OldCat...'s blog

By OldCat..., history, 8 years ago, In English

https://open.kattis.com/problems/physicalmusic how to solve this problem, help please!!!

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

problem can be simplified into:

for every index i, find out if there exist an index j (i < j) where a[i] > a[j] if it exist, then add a[i] to the answer

this is basically the same as counting inversions...