摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; int p[N], sz[N]; int find(int x) { if (p[x] != x) p[x] = find(p[x]); return p[x 阅读全文
posted @ 2022-05-02 21:28 wKingYu 阅读(29) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; int p[N]; int find(int x) { if (p[x] != x) p[x] = find(p[x]); return p[x]; } in 阅读全文
posted @ 2022-05-02 20:54 wKingYu 阅读(33) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; const int M = 5e6 + 10; int son[M][2], idx; int a[N]; void insert(int x) { int 阅读全文
posted @ 2022-05-02 20:04 wKingYu 阅读(52) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 6e5 + 10; int son[N][26], cnt[N], idx; char str[N]; void insert(char str[]) { int p = 0; 阅读全文
posted @ 2022-05-02 17:15 wKingYu 阅读(45) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; const int M = 1e6 + 10; int ne[N]; int main() { int n, m; char p[N], s[M]; cin 阅读全文
posted @ 2022-05-02 16:35 wKingYu 阅读(30) 评论(0) 推荐(0)