typedef long long LL;
LL binaryPow(LL a,LL b,LL m){
if(b==0)return 1;
if(b%2==1)return a*binaryPow(a,b-1,m)%m;
else{
LL mul=binaryPow(a, b/2,m);
return mul*mul%m;
}
}
typedef long long LL;
LL binaryPow(LL a,LL b,LL m){
if(b==0)return 1;
if(b%2==1)return a*binaryPow(a,b-1,m)%m;
else{
LL mul=binaryPow(a, b/2,m);
return mul*mul%m;
}
}
本文标题:快速幂
本文链接:https://www.haomeiwen.com/subject/uuvrpctx.html
网友评论