14621번

· 백준
코드#include #include #include #include using namespace std;int n, m, lst[1003], u, v, d, cnt, res;char uv[1003]; // 대학교 성별 저장vector>> adj; // 길 저장// 유니온 파인드 for 크루스칼int find(int x) { if (x == lst[x]) return x; return lst[x] = find(lst[x]);}void merge(int x, int y) { x = find(x); y = find(y); if (x > y) lst[x] = y; else lst[y] = x;}// 비용 순 정렬bool cmp(pair> a, pair> b) { return a.first > n >> m; fo..