What's wrong in my approach

only 3 test cases are passing

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll a,b,c,d;
cin>>a>>b>>c;

d=pow(a,b);
cout<<d%c;

return 0;

}

Hello @shivamgoel150,

Your code won’t work for the given constraints:
1<=a,b,c<=100000
Reason:

So, use an optimized way to compute it.

Think of a different way to calculate modular exponential.
Hint: study about exp by squaring method algorithm.
Refer to the below-mentioned link for details:

Hope, this would help.
Give a like if you are satisfied.