ll pow_mod(ll a,ll b)
{
ll res=1;
while(b>0)
{
if(b&1)
{
res=res*a%mod;
}
a=a*a%mod;
b>>=1;
}
return res%mod;
}
快速幂模板
最新推荐文章于 2022-04-07 10:51:06 发布
ll pow_mod(ll a,ll b)
{
ll res=1;
while(b>0)
{
if(b&1)
{
res=res*a%mod;
}
a=a*a%mod;
b>>=1;
}
return res%mod;
}