Why showing tle in 1 case

although i have use logn to solve pow but my sl. is showing tle please tell mistake.
https://ide.codingblocks.com/s/180444 is my code link

Your code is absolutely correct. But still it is prone to tle in tighter cases. Try these two things to reduce time.

  1. Whenever your pass a vector<vector> in the function use & to pass by reference as it does not make a copy and uses the same previous vector<vector> .
    Eg : vector<vector> &a
  2. In pow function use iterative method rather than recursion approach.

@Adarshrajpandey if you feel your issue has been resolved then please mark this doubt as resolved.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.