KMP
D.Fu
试问岭南应不好,却道此心安处是吾乡
展开
-
poj——2752 KMP||NEX数组的活用,【经典题】
The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek th...原创 2018-08-18 20:44:46 · 298 阅读 · 0 评论 -
HDU——3746 【kmp】|| next数组的活用 || 【经典题】
CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and thinking about how to...原创 2018-08-18 21:40:16 · 166 阅读 · 0 评论 -
hdu1687 oulipo KMP模板入门
题意就是很直接的KMP模板题的要求,先给你一个子文本和一个文本,然后问你这个子文本在文本中出现几次,注意AZA,在AZAZAZA 中是算三次。 代码: #include<iostream> #include<cstdio> #include<cstring> #include<string> using namespace std; con...原创 2018-10-20 16:53:19 · 204 阅读 · 0 评论 -
hdu 2087 KMP模板题 入门
问在父文本中子文本出现多少次,不能算重合部分,也就是说aaaaaa,aa只出现三次 思路:kmp!!!!!!,其实这道题用BF算法反而更快(滑稽)就是不在kmp函数中调用getnext函数; 代码 #include<iostream> #include<string> #include<cstring> using namespace std; co...原创 2018-10-20 17:10:06 · 196 阅读 · 0 评论 -
HDu 6153 a secret 扩展KMP模板
题意大致就是给你两个串,然后让你求第二个串的各个后缀在第一个串的出现次数,然后让次数乘该后缀的长度累加输出,最后结果是对1e9+7取模 思路:在讲具体思路之前,如果对扩展kmp不了解或者没听说过的话,建议先看看这个博客https://blog.csdn.net/dyx404514/article/details/41831947 回归正题:我们首先要对这个问题进行转换,因为在我所学过的算法中大...原创 2018-10-23 16:26:57 · 144 阅读 · 0 评论