#include<iostream> #include<algorithm> #include<cstring> #define ll long long #include<cstdio> #define MAXN 200005 using namespace std; int F[MAXN]; int num[MAXN]; ll s[MAXN]; struct Edge{ int a,b,cost; }e[MAXN]; int cmp(Edge &…
Conquer a New Region Time Limit: 5 Seconds Memory Limit: 32768 KB The wheel of the history rolling forward, our king conquered a new region in a distant continent. There are N towns (numbered from 1 to N) in this region connected by several road…