典型分治思想
//b^p%k
ll quick_pow(ll b ,ll p,ll k)
{ll ans =1,base = b;while(p!=0){if(p&1!=0) ans = ans *base%k;base =base*base%k;p/=2;}return ans;
}
典型分治思想
//b^p%k
ll quick_pow(ll b ,ll p,ll k)
{ll ans =1,base = b;while(p!=0){if(p&1!=0) ans = ans *base%k;base =base*base%k;p/=2;}return ans;
}
转:https://www.cnblogs.com/corx/p/8524946.html