What is Wrong with PUMPIMG code??

Solution 1 Solution 2

Can Somebody Help me to Debug my Solutions. It has divide and conquer approach.

Thanks in Advance

I think you just forgot that question contains input sample test case T also.
when I run your code with adding input T I got the correct answer ( https://www.codechef.com/viewsolution/21142394 ).
I don’t think we need segment tree for this problem.
link to my code without segment tree ( https://www.codechef.com/viewsolution/21142206 )

1 Like

why my code (https://www.codechef.com/viewsolution/21135941)is getting TLE as I did similar to vipin1407(https://www.codechef.com/viewsolution/21142206 ).

Thanks in Advance

//