并查集基础题目
http://blog.sina.com.cn/s/blog_6635898a0100kco0.html
这里用opp数组表示不在一个帮派的编号(2值)感觉思路比较清晰
#include <iostream>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cctype>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <cstring>
#include <queue>
using namespace std;
///宏定义
const int INF = 20000000;
const int MAXN = 100050;
///全局变量 和 函数
int father[MAXN];
int opp[MAXN];
int find_set(int x)
{
if (x != father[x])
father[x] = find_set(father[x]);
return father[x];
}
void