摘要:
模拟过程走一遍即可 #include <bits/stdc++.h> using namespace std; const int N = 110; int M[N]; #define x first #define y second int main() { int n; cin >> n; in 阅读全文
posted @ 2024-08-31 20:26
Frodnx
阅读(19)
评论(0)
推荐(0)
摘要:
硬写的 // 我也不知道多长时间了,估计有40min #include <bits/stdc++.h> using namespace std; const int N = 50; int hou[N], zhong[N]; class Node { public: int val; int wei 阅读全文
posted @ 2024-08-31 19:15
Frodnx
阅读(13)
评论(0)
推荐(0)
摘要:
并查集 int p[N]; // 储存祖宗节点 int cnt[N]; // 用于统计集合元素个数 bool flag[N]; // 储存节点是否出现 init函数 void init() { for(int i = 1; i <= N; ++ i) { p[i] = i; cnt[i] = 1; 阅读全文
posted @ 2024-08-31 16:49
Frodnx
阅读(16)
评论(0)
推荐(0)
浙公网安备 33010602011771号