http://blog.csdn.net/zy691357966/article/details/39735701
int quickpow(
int m,
int n,
int k)
{
int b =
1;
while (n >
0)
{
if (n &
1)
b = (b
*m)
%k;
n = n >>
1 ;
m = (
m*m)
%k;
}
return b;
}
好些日子才发现上面的图是错的; 因为最后不是加号是*;
Ll xx(Ll a,Ll b){
Ll ans=
0;
for(;b;b>>=
1,a=(a+a)
%mo)
if(b&
1)ans=(ans+a)
%mo;
return ans;
}
转载请注明原文地址: https://ju.6miu.com/read-150186.html