摘要: 题目传送门 一、模板方法 #include <bits/stdc++.h> using namespace std; const int K = 130; //一个大于128的数字 const int MOD = 23333; //素数常数 int n; //字符串个数 int ans; //结果 阅读全文
posted @ 2021-08-06 13:47 糖豆爸爸 阅读(88) 评论(0) 推荐(0)
摘要: 题目传送门 C++代码 #include <bits/stdc++.h> using namespace std; int n;//城镇数目 int m;//道路数目 int x, y; //城镇的编号 const int N = 1010; int fa[N]; //并查集数组 //要深入理解这个 阅读全文
posted @ 2021-08-06 10:57 糖豆爸爸 阅读(61) 评论(0) 推荐(0)
摘要: 题目传送门 一、并查集模板 #include <bits/stdc++.h> using namespace std; const int N = 5010; int n; //n个人 int m; //m个亲戚 int p; //询问p对亲戚关系 int x, y; //输入两个人之间的关系 in 阅读全文
posted @ 2021-08-06 10:41 糖豆爸爸 阅读(122) 评论(0) 推荐(0)
Live2D