Hello there
I'm trying to solve this problem with this code
I'm using a segment tree with a treap in each node and the trick from this blog
I keep getting WA on testcase 20 and i have rewritten the code a few times and debugged for hours looking for the reason
If anyone could find my error that would be really appreciated
Same problem. WA 20 or TL 20
It's a common misconception that people think SPOJ gives WA/TLE verdict on the failed case. Actually, SPOJ runs your code on all the inputs files and then shows the verdict.