快速幂板子题
#include<iostream>
using namespace std;
typedef long long LL;
int qmi(LL a,LL b,LL p){
int res=1;
while(b){
if(b&1)res=(LL)res*a%p;
b>>=1;
a=(LL)a*a%p;
}
return res%p;
}
int main(){
LL a,b,p;
cin>>a>>b>>p;
cout<<qmi(a,b,p)<<endl;
return 0;
}