摘要: 带扩展域的并查集 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n, m; int p[N]; struct Node { int a, b; 阅读全文
posted @ 2022-08-16 21:18 wKingYu 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 并查集 + 树的判定 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n; int p[N]; int find(int x) { if (p[ 阅读全文
posted @ 2022-08-16 17:22 wKingYu 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 带扩展域的并查集 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n, m; int p[N]; int find(int x) { if (p 阅读全文
posted @ 2022-08-16 16:47 wKingYu 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 并查集 + 树的判定 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e4 + 10; int n; int p[N]; int find(int x) { if (p[ 阅读全文
posted @ 2022-08-16 14:21 wKingYu 阅读(16) 评论(0) 推荐(0) 编辑