![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串:Manacher
文章平均质量分 53
skajre
这个作者很懒,什么都没留下…
展开
-
HDU 3068 最长回文子串(manacher算法)
// // main.cpp // Richard // // Created by 邵金杰 on 16/9/27. // Copyright © 2016年 邵金杰. All rights reserved. // #include #include #include #include using namespace std; const int maxn=110000+100;原创 2016-09-27 20:35:07 · 212 阅读 · 0 评论 -
HDU 3294 Girl's research(最长回文子串)
// // main.cpp // Richard // // Created by 邵金杰 on 16/9/27. // Copyright © 2016年 邵金杰. All rights reserved. // #include #include #include #include using namespace std; const int maxn=200000+100;原创 2016-09-27 23:02:17 · 206 阅读 · 0 评论 -
HDU 4513 完美队列II(最长回文子串)
这题扩大半径的时候需要特判,晚上脑子乱,弄了好久。 // // main.cpp // Richard // // Created by 邵金杰 on 16/9/27. // Copyright © 2016年 邵金杰. All rights reserved. // #include #include #include #include using namespace std;原创 2016-09-28 00:06:28 · 238 阅读 · 0 评论 -
UVA 1470 Castting Spells(manacher)
这题很容易看出来是个判断回文,manacher板子直接上了,但是最后被细节卡了= =。 细节1:因为回文串ww^r个数肯定是偶数,所以枚举时,只能枚举‘#’的位置。 细节2:因为细节1说了,'#'左右两边字符串长度一定是偶数,那么如果当前位置的v=p[i]-1必须为偶数,而且v时整个字符串的长度,所以膜4必须为0,如果不符合条件,那么只能减小回文的长度,增大是肯定不可能的。 细节3:当v满足原创 2016-11-10 09:45:29 · 236 阅读 · 0 评论