Hey can anyone please help me with this problem. I’m repeatedly getting wrong answer. I think this question is a implementation of augmenting data structures as described in cormen. I have done the same. I have implemented a Red Black Tree with size attribute so that i can find the Kth order statistic. I have tested my code with many inputs its giving correct answer i suppose. Please can any one give me any test case where my code gives WA.

SPOJ Problem Link

My Code Ideone Link

any one can give me any corner cases plz?

Try the test case given there. I’m stuck with the same problem. I’m trying a simpler BIT implementation with co-ordinate compression and offline processing. Still debugging the code.

1 Like

Thanks for the link. I debugged my code and got accepted :slight_smile:

Please Click on accept answer then. Thanks.