Hello ,
I need help with problem 11235 — RMQ of UVA
Link : — https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2176
Approach applied : I know that this question is of segment tree, and the values being in sorted order can further be used to calculate frequencies . The new frequency array should be pushed into segment tree , but after that I am lost . How would I then use the segment tree to calculate the answer , because I can't calculate answer for like (5,10) etc. Any help is appreciated !