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

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

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

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

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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...