![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
manachar
文章平均质量分 77
TheWolfWhistlingSong
蜜の夜明け
展开
-
Bzoj2084:[Poi2010]Antisymmetry:manachar算法
题目链接:2086:[Poi2010]Blocks 一开始看错题了以为重复串不计数QAQ manachar裸题,显然只有当前位置不是原串中的字符时才可能有答案,也就是扩展后的串中奇数串才会有贡献 注意必须只做奇数串,否则偶数串有可能会影响maxid什么的从而影响答案 #include #include #include #include #define LL long long using原创 2016-04-07 06:44:32 · 471 阅读 · 0 评论 -
Bzoj3790:神奇项链:manacher+线段树+贪心
题目链接:3790:神奇项链 处理出每个位置的最长的回文串,然后就是用最少的回文串覆盖整个区间 贪心一下,线段树维护即可,每次在左端点在合法区间里的回文串中找右端点最远的即可 #include #include #include #include #include using namespace std; const int maxn=210000; const int inf=0x7fff原创 2016-07-14 15:52:38 · 405 阅读 · 0 评论