摘要:
```cpp include include include include using namespace std; const int MAXN=1000010; struct AC_automaton{ int tr[MAXN][26], cnt; //TRIE int e[MAXN]; // 阅读全文
摘要:
loj.ac 10049 代码1:Trie树+指针实现 时间复杂度:O(T N 10),每个字符串长度最大为10,在树上插入一个字符串最多10步。 cpp include include include using namespace std; int T, flag; //flag为有前缀标记 c 阅读全文
摘要:
luogu P3375 cpp include include include using namespace std; char s[1000010], t[1000010]; int nxt[1000010], m, n; int main() { scanf("%s%s", s+1, t+1) 阅读全文
摘要:
loj.ac 10034 方法1:存储为哈希表,再查询,100%可靠,可处理hash冲突。 cpp include include include using namespace std; const int mod1=1e6+3, mod2=1e6+9, p1=47, p2=79, N=30010 阅读全文
摘要:
luogu P3370 cpp include include include include using namespace std; typedef unsigned long long ull; int n; char str[1510]; set S; ull str_hash(char s 阅读全文
摘要:
```cpp include include include include using namespace std; const int INF=0x3fffffff; int node_cnt; //结点计数器 struct Node; typedef Node pNode; //结点指针 st 阅读全文
摘要:
```cpp //计算过程中随时取模,否则一般会wrong 7个点 include include include using namespace std; const int maxn=100010; struct edge{ int t; edge nxt; edge(int to, edge 阅读全文
摘要:
关于割点的详细讲解见 "这篇文章" cpp //时间复杂度:O(N+M) include include include include using namespace std; const int maxn=20010; int N, M, bj[maxn], ans=0, dfn[maxn], 阅读全文
摘要:
什么是差分约束系统? 差分约束系统是一种特殊的$N$元一次不等式组,它包含$N$个变量$x_1 \dots x_N$以及$M$个约束条件,每个约束条件都是由两个变量作差构成的,形如$x_i x_j\le c_k$,其中$c_k$是常数,$1\le i, j\le N, 1\le k \le M$。我 阅读全文