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
A data structure for maximizing and asking sum of a segment
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