A data structure for maximizing and asking sum of a segment

Revision en1, by Shayan.P, 2018-06-19 19:04:22

Hello every one... I need a data structure handling two type of queries. 1-Maximize(l,r,x) 2-Sum(l,r) I have a O(sqrt(n)*log(n)) solution using sqrt decomposition + set.But I am looking for a better solution. Thanks in advance

Tags #data structure

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Shayan.P 2018-06-19 19:05:39 8
en1 English Shayan.P 2018-06-19 19:04:22 290 Initial revision (published)