(int x, int y)
| 127 | } |
| 128 | |
| 129 | public static void link(int x, int y) { |
| 130 | x = find(belong[x]); |
| 131 | y = find(belong[y]); |
| 132 | while (x != y) { |
| 133 | if (dep[x] >= dep[y]) { |
| 134 | union(x, up[x]); |
| 135 | x = find(x); |
| 136 | } else { |
| 137 | union(y, up[y]); |
| 138 | y = find(y); |
| 139 | } |
| 140 | ebccCnt--; |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | public static void main(String[] args) throws Exception { |
| 145 | FastReader in = new FastReader(System.in); |