1118 Birds in Forest (25 point(s))

題解 並查集。 #include<cstdio> #include<iostream> #include<algorithm> using namespace std; const int MAXN = 1e4 + 10; int father[MAXN], book[MAXN], cnt[MAXN]; int find(int x) { return x == father[x] ? x :
相關文章
相關標籤/搜索