#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll a,b,p;
ll Pow(ll x,ll y){
ll ans=1;
while(y){
if(y&1)ans=ans*x%p;
x=x*x%p;
y>>=1;
}
return ans;
}
int main(){
cin>>a>>b>>p;
cout<<Pow(a,b)%p;
}
位运算-快速幂
最新推荐文章于 2021-08-07 18:05:20 发布