摘要:
AC 自动机 思路 我们知道,KMP 干的事是将一个字符串同另一个字符串匹配,但是如果有多个模式串和多个匹配串,那么 KMP 的时间复杂度就会来到 \(\mathcal O(n^2)\)。 那么怎么降低时间复杂度呢? 考虑到有多个字符串,我们先把匹配串建出来一颗字典树。 我们仿照 KMP 实现: 定 阅读全文
posted @ 2026-07-22 11:56
Hty111
阅读(4)
评论(0)
推荐(0)
摘要:
线段树 普通线段树 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 4e5 + 5; int n; LL a[N]; #define ls u << 1 #define rs u << 阅读全文
posted @ 2026-07-22 11:06
Hty111
阅读(0)
评论(0)
推荐(0)

浙公网安备 33010602011771号