![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
此间无物
这个作者很懒,什么都没留下…
展开
-
P7114 [NOIP2020] 字符串匹配
链接 代码先行 #include <bits/stdc++.h> using namespace std; const int maxx = (1 << 21); string s; int pos[maxx][26],pre[maxx][26],cpos[maxx],cpre[maxx]; int cnt[maxx];//辅助统计当前奇数个数为i的个数 int temp,postodd,temp2,postodd2; int z[maxx]; int T,len; int原创 2021-10-07 11:40:12 · 199 阅读 · 0 评论 -
z函数(扩展kmp)
两个重要的点:1.i - l 2.r 一个简单的证明: (来源:题解-洛谷P5410 【模板】扩展 KMP(Z 函数) - George1123 - 博客园) 借助前面处理的两个点来避免重复匹配 代码: void exkmp(string x)//匹配本身 { l = 0; lz = x.length(); for (i = 1; i < lz; i++)//最好从1开始,0预处理掉 {...原创 2021-10-06 14:24:22 · 345 阅读 · 0 评论 -
hash算法
板子已会 2021.9.23(用的是双哈希,模数19260817和19660813)原创 2021-09-23 21:43:43 · 143 阅读 · 0 评论