755c专题

CodeForces 755C PolandBall and Forest

题目链接:http://codeforces.com/contest/755/problem/C 题意:给你一个长度为n的序列,a[i]表示a[i]与i有条边相连,让你求这个序列构成的森林里有多少棵树 解析!:裸的并查集 #include <bits/stdc++.h>using namespace std;const int maxn = 1e5+100;int fa[maxn],a