字符串hash模版


字符串hash模版

原题目:P3370 【模板】字符串哈希 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

#include
using namespace std;
typedef long long ll;
const ll seed=31,mod1=1e9+7,mod2=1e9+9,maxn=1e5+7;
int n;
struct hash_s{
    ll hash1,hash2;
    hash_s():hash1(0),hash2(0){}
    const bool operator <(hash_s x)const{
        if(hash1>n;
    for(int i=0;i>ss;
        hashes[i]=f(ss);
    }
    map mp;
    int ans=0;
    for(int i=0;i