#include bits/stdc++.h#define B 3#define ULL unsigned long long#define maxn 500010using namespace std;char s[maxn];int a[maxn],b[maxn],N;ULL ah[maxn],bh[maxn],n[maxn],cnt=0;int judge(int pos,int d){//pos字串中空位置,d距离中空的字符
点我呐
#includebits/stdc++.husing namespace std;int getchs(char c){return c-'a'+1;}int n;int jz=29;int mod=1000000007;string s;vectorlong long hashhz(string s){ vectorlong long HS(400005,0);long long jzs=1;for(int i=s.size()-1;i=0;i--){HS[s.size()
点我呐
#includeiostream#includemap#includestringusing namespace std;int main(){ int n; char c[207]; string d; cinn; mapstring,intm; while(cind){ cin.ignore(); if(d=="add"){ cin.getline(c,207); m[c]=1; } if(d=="find"){ cin.getline(c,207); if(m.find
点我呐
#include bits/stdc++.husing namespace std;int n,j,ne[1000101];long long sum;string s;void get_next(){ for(int i=1;in;i++) { while (js[i]!=s[j]){ j=ne[j];} if(s[i]==s[j]){ j++;} ne[i+1]=j; }}int main(){ cinns; j=0; get_next(); for(int i=1;i=
点我呐
#includebits/stdc++.husing namespace std;string s="abababc",t="aba";int nt[1000000];//vectorintvoid getnext(string t){nt[0]=-1;int i=0,j=nt[i];while(i=t.length())if(j==-1||t[i]==t[j]) nt[++i]=++j;else j=nt[j];}void find(string s,string t){i
点我呐
#includebits/stdc++.husing namespace std;string s="abababc",t="aba";int nt[10000000];//vectorintvoid getnext(string t){nt[0]=-1;int i=0,j=nt[i];while(i=t.length())if(j==-1||t[i]==t[j]) nt[++i]=++j;else j=nt[j];}int find(string s,string t){i
点我呐
#includebits/stdc++.husing namespace std;string s="abababc",t="aba";int nt[1000000];//vectorintvoid getnext(string t){nt[0]=-1;int i=0,j=nt[i];while(i=t.length())if(j==-1||t[i]==t[j]) nt[++i]=++j;else j=nt[j];}int main(){int k;cink;cins;get
点我呐
#include bits/stdc++.husing namespace std;int mod=1000000007;//最大值int base=257;//进制数位//单个字符哈希值int getcharhs(char c){ return c-'a'+1;}//字符串前缀哈希值vectorlong long getprefix(string s){ vectorlong long
点我呐