
manacher
西瓜君wtml
这个作者很懒,什么都没留下…
展开
-
V - 吉哥系列故事――完美队形II
吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] … h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变,且必须都是在原队形中连续的; 2、左右对称,假设有m个人形成新的队形,则第1个人和第m个人身高相同,第2个人和第m-1个人身原创 2017-09-15 15:39:35 · 223 阅读 · 0 评论 -
W - Girls' research
One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps: First step: girls will write a long string (only contains lower case)原创 2017-09-15 19:28:40 · 382 阅读 · 0 评论 -
hdu 3068 最长回文 Manacher算法模板题
题意: 给定一个字符串,输出其最长回文串的长度。题解: 运用马拉车算法模板即可。代码: #include #include #include using namespace std;const int N = 200010;char s[N], str[N*2];int p[N*2];int manacher()原创 2017-07-28 19:24:08 · 245 阅读 · 0 评论 -
hdu 3613 manacher算法
Problem Description 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 neckla原创 2017-09-20 16:20:47 · 218 阅读 · 0 评论