I'm trying to solve MKTHNUM on SPOJ using Wavelet Tree Data structures from rachitjain's blog
Here is my code: http://ideone.com/BMZqj0
Unfortunately, I keep getting RTE on large test cases.
However, I have also tested my solution on this problem with the exact same code (only differs in use of test cases) and it got accepted on that problem.
Can anyone tell why my solution getting RTE on SPOJ while getting accepted on other OJ?
P.S. I also got RTE on KQUERY problem using the same data structure.
Thanks.