大数乘法可能还没来得及取模就爆了long long,采用龟速乘优化
12345678910111213141516
#include<bits/stdc++.h>using namespace std;typedef long long ll;ll mod;ll mul(ll a,ll b){ ll ans=0; while(b) { if(b&1) ans=(ans+a)%mod; a=(a+a)%mod; b>>=1; } return ans;}