摘要: 【算法】(manacher+贪心)||(manacher+DP+树状数组/线段树) 【题解】 manacher求回文串,后得到线段,做一点计算映射回原串线段。 然后问题转化为可重叠区间线段覆盖问题,可以贪心解决。 排序左端点,同一左端点取最长段,然后在此段中找到右端点最靠右的线段,线性更新并累加。 阅读全文
posted @ 2017-04-05 21:19 ONION_CYC 阅读(353) 评论(0) 推荐(0) 编辑
摘要: 【算法】manacher 【题解】【算法】字符串 #include<cstdio> #include<algorithm> #include<cstring> using namespace std; const int maxn=300010; int n,p[maxn]; char s[maxn 阅读全文
posted @ 2017-04-05 19:16 ONION_CYC 阅读(177) 评论(0) 推荐(0) 编辑