Online approach for range inversion count?

Правка en1, от FruitLoop, 2015-09-27 07:42:49

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?

Теги segment tree, fenwick tree, data structures, inversions

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский FruitLoop 2015-09-27 07:42:49 371 Initial revision (published)