运用分治,复杂度logn
typedef long long LL; LL mod; LL f(LL a,LL b){ if(b==1) return a; if(b==0) return 1; LL t=f(a,b/2); return b%2==0? t*t%mod : (((t*t)%mod)*a)%mod; }