codeforces #600 div2 D - Harmonious Graph ( disjoint set )
https://codeforces.com/contest/1253/problem/D 처음으로 버츄얼이 아닌 실제 시험에서 4솔을 했다. undirected 그래프가 harmonious -> if and only if, For every triple of integers (l,m,r) such that 1≤l> m; fill(uf, uf + MAX, -1); P e[MAX]; vector can; for (int i = 0, u, v; i > u >> v; if (u > v) swap(u, v); merge(u, v); e[i] = { u,v }; } sort(e, e + m); int st = e[0].first, en = e[0].second; for (int i = 1; ..
2019. 11. 20.