快速幂
template<typename T>
T pow(T x,int n){
if(!n)return 1;
T tmp=pow(x,n>>1);
if(n&1)return tmp*tmp%mod*x%mod;
return tmp*tmp%mod;
}剪贴板
template<typename T>
T pow(T x,int n){
if(!n)return 1;
T tmp=pow(x,n>>1);
if(n&1)return tmp*tmp%mod*x%mod;
return tmp*tmp%mod;
}