WA in "The Power of Modulo N" (CGPOWN)

Help me out, Tried may times but still getting WA for Subtask 3.

problem:-(https://www.codechef.com/problems/CGPOWN)

My solution:-

https://www.codechef.com/viewsolution/29023914

Look at the constraints. You may be storing values on the order of 10^24.
You need to make your own modular multiplication function.
If you need to see how to implement here is my code

ww.codechef.com/viewsolution/29026385

2 Likes