Can someone please help me with this [problem][1] from spoj on segment trees. I am storing maximum and second maximum element at each node of tree but getting wrong answer.
Here is my
[2].
Any help is appreciated.:)
[1]: http://www.spoj.com/problems/KGSS/
[2]: https://ideone.com/mOvfZ5