![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
manacher
Max_1_
这个作者很懒,什么都没留下…
展开
-
The 16th Zhejiang Provincial Collegiate Programming Contest - K Strings in the Pocket(zoj4110)
题意:两个串s,t,多少对不同的(l,r),使得翻转s[l,r]后s等于t。 分析: s不等于t时,找出左右两端第一个不相等的位置a,b,首先判断翻转[a,b]后s是否等于t,接着往左右两端扫一遍判断字符是否相等。s等于t时,很容易想到就是s的回文串个数。。。。 一开始没看空间限制用回文自动机一直Segmentation Fault ,改为马拉车算法即可。 #include<i...原创 2019-04-28 14:13:10 · 272 阅读 · 0 评论 -
HDU多校第二场 - hdoj6599 I Love Palindrome String
题目大意:给一个长度n的字符串S,问长度分别为1 - n 的回文子串个数,且每个回文子串S(l,r) 需满足 S(l,(l+r)/2)也是回文串。 回文自动机处理出不同回文子串的个数,然后用马拉车判断每个回文串是否满足要求即可。。 #include<iostream> #include<cstdio> #include<cmath> #inc...原创 2019-07-25 01:06:15 · 143 阅读 · 0 评论