哈希模板

//
#define ll long long 
#define P pair<ll,ll>
#define MP make_pair
#define mod 1000000007
#define fi first
#define se second
P operator +(const P a,const P b){return MP((a.fi+b.fi)%mod,(a.se+b.se)%mod);}
P operator +(const P a,const int b){return MP((a.fi+b)%mod,(a.se+b)%mod);}
P operator -(const P a,const P b){return MP((a.fi-b.fi+mod)%mod,(a.se-b.se+mod)%mod);}
P operator *(const P a,const P b){return MP((a.fi*b.fi)%mod,(a.se*b.se)%mod);}
const P bs=MP(233333,2333333);
P has[N],tot;
P p[12][12];
//

has[0] = MP(1,1);
    for(int i = 1;i<=n;++i){
        has[i] = has[i-1] * bs;
        tot = tot + has[i];
    }
View Code

 

posted @ 2020-09-11 21:18  小布鞋  阅读(25)  评论(0编辑  收藏