FruitLoop's blog

By FruitLoop, history, 9 years ago, In English

Given an array A of n integers. M queries are given in the form of l, r. For each query, I need to count the number of inversions in subarray A from l to r. I know the offline approach to solve this using BIT and sqrt decomposition.

Is it possible to solve this problem online using segment tree or any other data structure?

  • Vote: I like it
  • +6
  • Vote: I do not like it