Help wanted: Wavelet tree

Правка en1, от Hostek, 2025-03-09 17:36:51

Hey, I want to solve this problem: Given array a of length n handle these queries online (each query in O(logn))

-> l r k (input) which means output the sum of k largest numbers on segment [l,r] in array a.

($$$n <= 10^6$$$ , $$$q <= 10^6$$$ (q is number of queries), the array has only positive integers ($$$a_i <= 10^9$$$))

I know it is possible to do using Wavelet tree.

Теги wavelet tree, wavelet, help, implementation

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Hostek 2025-03-09 17:36:51 396 Initial revision (published)