标签:for pow ret amp code 合数 return pre power
LL fpow(LL x, LL power, LL mod)
{
x %= mod;
LL ans = 1;
for (; power; power >>= 1, (x *= x) %= mod)
if(power & 1) (ans *= x) %= mod;
return ans;
}
LL qinv(LL a)
{
LL x = fpow(a, mod - 2, mod);
return x;
}
标签:for pow ret amp code 合数 return pre power
原文地址:https://www.cnblogs.com/reshuffle/p/12495092.html