女朋友最喜欢的快速幂板子来了 ll Quick(ll a,ll b) { ll SUM=1; while(b) { if(b&1) SUM=SUM*a; b/=2,a=a*a; } return SUM; } 注意: 在快速幂的过程中经常对某个数求余,也就是 %mod 防止爆longlong.