本文为快速幂板子。 C++复制int pw(int a,int b) { int res=1; for(;b;b/=2,a=1ll*a*a%mod) if(b&1)res=1ll*res*a%mod; return res; }