![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串 kmp
捣乱天才
华东交通大学
展开
-
hdu4749 Parade Show(kmp)
题目链接:点这里!!! 题意: 给定两个数组a(文本串),b(模式串)。问文本串能匹配出多少个模式串(不允许重叠)。"匹配"的意思各自离散化之后的串是一样的。 例如:(20,2,2,5,1,3,21) 与 (10 10 15,1) 。(2,2,5,7)与(10,10,15,1)是匹配的。 数据范围len 题解: 1、首先看到这种题目涉及到模式串的匹配问题,很容易往km原创 2016-04-20 21:10:04 · 345 阅读 · 0 评论 -
hdu1867 A + B for you again(kmp)
题目链接:点这里!!!! 题意:(简单易懂自己看) 题解:直接kmp,但是要注意在+号前面的字符串指针一定要指到最后!!! 代码: #include #include #include #include #include #include #include #include #include #include #include #include #inclu原创 2016-04-20 21:19:24 · 313 阅读 · 0 评论 -
Codeforces Round #344 (Div. 2) D. Messenger(kmp)
题目链接:点这里!!!! 题意: 给你两个字符串a,b,求b在a中出现的次数。 字符串出现的形式为a1-c1 a2-c2 a3-c3 ... an-cn(b字符串为m)。ai-ci表示ci这个字符连续出现了ai次。 比如:3-a 2-b 2-a 3-d 是aaabbaaddd。 取值范围:m,n 题解: 1、如果出现3-a 7-a这种相邻两个的字符是一样的,先合并掉。原创 2016-07-13 13:49:12 · 234 阅读 · 0 评论