can you please tell in this question...
http://www.spoj.com/problems/GSS1/
what should i store at each node ? i have given 11 WA and 4 TLE since last week. can you help me in this ? i want to know how can we judge that we can merge the left array with right one or not ? i have left array and i have right array (part of big one) , then how should i make my tree that at each point i can judge that i can merge it with left or not. thanks if you can help me.
I solved this problem using segment trees (I think it's the only approach which pass on system tests within the time limit)
You can learn more about them here: English Russian