随笔分类 - 字符串-manacher
摘要:KMP+manacher:https://www.luogu.com.cn/problem/P6216 对于一对字符串 \((s_1,s_2)\),若 \(s_1\) 的长度为奇数的子串 \((l,r)\) 满足 \((l,r)\) 是回文的,那么 \(s_1\) 的“分数”会增加 \(s_2\)
阅读全文
摘要:P3805【模板】manacher算法:https://www.luogu.com.cn/problem/P3805 求 \(S\) 中的最大回文串长度,\(|S|\le 1.1\cdot 10^7\) 考虑一个 \(n^2\) 暴力,枚举对称轴(可能是以一个字符为对称轴,也可能是以两个字符的间隙)
阅读全文
摘要:https://www.luogu.com.cn/problem/P4555 https://darkbzoj.tk/problem/2565 \(T=XY\),其中 \(X,Y\) 均为回文串,求 \(T\) 的最大长度 首先把每两个原有字符的间隙填充上其他字符,然后可以用 manacher 求出
阅读全文

浙公网安备 33010602011771号