Hy, I am having the problem with this task for over a 2 days.
spoj.com/problems/GSS1/ I try to solve it with segment tree and I think I did it but evaluator always say no. Can anyone help me or give me tricky test case.
I was using array des and lij. Des is if can that segment accept number from right side and lij if can that segment accept number from left side. pastebin.com/G78LuRmY
Thanks very much. 