#include <iostream> #include <vector> #include <algorithm> using namespace std; struct Edge{ int u,v,w; bool operator<(const Edge& other)const{ return w<other.w; } }; vector<int> parent,rank_set; int find(int x){ if(parent[x]!=x)parent[x]=...