{intfa1 =find(a);intfb =find(b); fa[fa1]=fb; }intmain() {//STDINcin >> n >> m >>k; init();inta, b, c;while(m--) { cin>> a >> b >>c;if(c ==1) { unite(a, b); }if(c == -1) { se[a].insert(b), se[b].insert(a); } }for(inti =1; i <= k; ...