1922
[골4] 1922 - 네트워크 연결
#include #include #include using namespace std; #define MAX 100001 struct sEdge { int val, a, b; }; vector graph; int parent[MAX]; int res = 0; int Find(int x) { return (parent[x] == x) ? x : parent[x] = Find(parent[x]); } void Union(int x, int y) { x = Find(x), y = Find(y); if (x != y) parent[y] = x; } bool Cmp(sEdge edge1, sEdge edge2) { return (edge1.val < edge2.val); } int main() { ios_base:..