Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <algorithm>#include <cstdio>#include<cstring>#include <cstdlib>using namespace std;/***Thx**//***常驻数据介绍*i : sweet i, unique and vital.*ll : strict ll and Set.*/#define MAXN_E 1000010#define MAXN_V 100010struct Edge{int fm,to;int dist = 1010;} e[MAXN_E];int fa[MAXN_V],n,m;bool cmp(Edge a,Edge b){return a.dist<b.dist;}