欢迎使用本站,预祝练习时长两年半的选手们到成功! [本模块信息来自tem/def/head]
  • [提高字符串算法] 1462:Antisymmetry 日期:2024-06-15 22:43:43 点击:161

    #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距离中空的字符

    点我呐

  • [提高字符串算法] 1458:Seek the Name, Seek the Fame 日期:2024-06-15 22:41:30 点击:99

    #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()

    点我呐

  • [提高字符串算法] 1456:【例题2】图书管理 日期:2024-06-15 22:40:50 点击:106

    #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

    点我呐

  • [提高字符串算法] 1468:OKR-Periods of Words 日期:2024-06-15 22:39:55 点击:116

    #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=

    点我呐

  • [提高字符串算法] 1466:【例题2】Power Strings 日期:2024-06-15 22:39:40 点击:191

    #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

    点我呐

  • [提高字符串算法] 1465:【例题1】剪花布条 日期:2024-06-15 22:38:44 点击:191

    #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

    点我呐

  • [提高字符串算法] 1467:Radio Transmission 日期:2024-06-15 22:37:37 点击:159

    #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

    点我呐

  • [提高字符串算法] 1458:Seek the Name, Seek the Fame 日期:2024-05-17 19:17:35 点击:79

    #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

    点我呐

  • 共 1 页/8 条记录
栏目列表
推荐内容
添加管理员微信