题解:快速幂模板
#include <iostream>
#include <cstdio>
using namespace std;
#define LL long long
LL a,b,c;
LL fast_pow(LL a,LL p)
{
LL ans=1;
for(;p;p>>=1,a=(a*a)%c)
if(p&1)
ans=(ans*a)%c;
return ans;
}
int main()
{
cin>>a>>b>>c;
cout<<fast_pow(a,b)<<endl;
return 0;
}