#include
using namespace std;
#define ll long long
ll fast_modulo(ll a, ll b,ll c)
{
a=(a%c);
ll product=1;
while(b!=0)
{
if(b&1)
product*=a;
a=a*a;
b=b>>1;
}
return product;
}
int main()
{
ll a,b,c;
cin>>a>>b>>c;
ll num=fast_modulo(a,b,c);
cout<<(num % c);
return 0;
}
Not able to pass all the test cases?
@namangarg31
take mod at every step https://ide.codingblocks.com/s/241199
i hope its clear if yes dont forget to mark it as resolved 