摘要: https://www.luogu.com.cn/problem/P3805 参考blog \(Manacher\) 首先,为了处理奇偶回文串问题,我们可以在字符之间加入$'#'\(,再把第一个字符定为\)'$'$ $r$表示当前到第$i$个字符的回文串最右边界 分$3$类讨论 具体看参考$blog 阅读全文
posted @ 2020-08-01 16:18 GK0328 阅读(86) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P4173 \(NTT\) 按照套路,把模式串$A$倒过来(注:一下公式中的$A$为已经倒过来的串) 定义$'*'$值为$0$,$'a'\cdots 'z'$值为$1\cdots 26$ 若$B$串在$i$位置匹配,那么必然有: \[ 阅读全文
posted @ 2020-08-01 13:56 GK0328 阅读(72) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P3338 \(FFT\) \[ E_{i}=\sum_{j=1}^{i-1} \frac{q_j}{(i-j)^2}-\sum_{j=i+1}^{n} \frac{q_j}{(i-j)^2}\\ 改成下标从0开始\\ E_{i}=\ 阅读全文
posted @ 2020-08-01 12:47 GK0328 阅读(101) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/CF528D 字符串匹配$/NTT$ 如果$k=0$,那么$KMP$轻松解决 当$k>0$时,我们可以对每个字符分别考虑 例如样例,用$'A'$去匹配: \[ AGCAATTCAT\\ ACAT \] 将模式串和文本串中非$'A'\( 阅读全文
posted @ 2020-08-01 12:38 GK0328 阅读(150) 评论(0) 推荐(0) 编辑