That thing was hard af to debug. I cant believe I missed that. set lowerbound and normal lowerbound. The more you know about STL XD
@vijju123 It took me 2 hours of thinking and googling to find it out. Glad to share it with others, and spare their time 
@taran_1407 There wasn’t too much messing
@vijju123 - Sorry xD i will try to put more readable code with some documentation before asking for help next time. Thank you for your efforts! and thanks bazsi once more.
@vijju123, pleaseeee have a look at the formatting of LRQUER editorial… I tried to use latex feature, but couldn’t…
Help!!
@taran_1407 thanks a lot!
one more thing please…it is written : “(min and max on the segment in the segment tree, dp[2][2], dp[2][2] and other things)”. What is the need to store min and max? We can calculate dp values by hand at base level and thus can combine them to get answrs for higher level. so, what is the need for them?
and last thing i have understood how to add elements(just add a node at last) but how to support erase operations? is min and max is something that requires for this one?
Mate, i haven’t myself implemented the solution yet. I knew about 2nd observation, so i wrote the proof here…
okay thanks taran but one request if you implement it in future please provide the solution link.
If i implement, i will post solution link.
