코드#include #include #include using namespace std;int n,m,a,b,c,res,lst[1003];vector> v;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;}int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; cin >> m; for(int i = 1; i > a >> b >> c; ..