Can Somebody Help me to Debug my Solutions. It has divide and conquer approach.
Thanks in Advance
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 )
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