![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
KMP & 扩展KMP & Manacher
YCQ_Lancet
骐骥一跃,不能十步,驽马十驾,功在不舍
展开
-
Seek the Name, Seek the Fame POJ - 2752 KMP
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原创 2017-08-16 11:06:14 · 265 阅读 · 0 评论 -
Count the string HDU - 3336 KMP+DP
It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example:s: "ab原创 2017-08-16 18:34:48 · 308 阅读 · 0 评论 -
Simpsons’ Hidden Talents HDU - 2594 kmp小变形
Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it? Homer: Take me for example. I want to find out if I have a talent in polit原创 2017-08-16 19:33:25 · 362 阅读 · 0 评论 -
STL中string类的运用---主要是翻转与子串获取
#include#include#include//STL reverse函数的头文件,reverse反转函数,using namespace std;int main(){ int cas,len,sub,maxn; int n,k,i,j; string s[102]; cin>>cas; while(cas--) {原创 2017-08-16 20:15:27 · 1131 阅读 · 0 评论 -
HDU 3613 Best Reward Manacher
After an uphill battle, General Li won a great victory. Now the head of state decide to reward him with honor and treasures for his great exploit.One of these treasures is a necklace made up of原创 2017-08-17 21:45:29 · 468 阅读 · 0 评论 -
拓展KMP算法详解
算法描述:设字符串T,长度为n,字符串S,长度为m。在线性时间内求出T的每一个后缀所对应S的最长前缀。假设T=“AAAAB”,S="AAAA"。我们从第一位开始匹配,匹配结果存放到ext数组中。显然ext【0】=4,然后我们就去计算ext【1】,显然ext【1】=3。如果还是如同算ext【0】这样的方法去匹配ext【2】会造成信息的浪费,因为前面有的信息已经知道了,就不需要一个一个再去比对原创 2017-08-22 09:13:44 · 5922 阅读 · 0 评论 -
Cyclic Nacklace HDU - 3746 KMP求循环节
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原创 2017-08-15 21:34:39 · 288 阅读 · 0 评论 -
Just another Robbery LightOJ - 1079 期望01背包
As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as much mone原创 2017-09-05 11:34:10 · 306 阅读 · 0 评论