(int u, int fa)
| 248 | } |
| 249 | |
| 250 | public static void centroidTree(int u, int fa) { |
| 251 | centfa[u] = fa; |
| 252 | vis[u] = true; |
| 253 | for (int e = head[u]; e > 0; e = nxt[e]) { |
| 254 | int v = to[e]; |
| 255 | if (!vis[v]) { |
| 256 | centroidTree(getCentroid(v, u), u); |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | public static int add(int jobi, int jobv, int l, int r, int i) { |
| 262 | if (i == 0) { |