NOIP2016#模拟考试 Day.2# T2 网络修复 【LCA + 并查集】
LCA + 并查集
#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<cstring>
using namespace std;
int N,T;
#define maxn 200000
struct edge{
int v;
edge* next;
}e[maxn<<1];
edge* head[maxn];
int a[maxn],b[maxn];
int totedge = 0;
void adde(