(int u)
| 202 | } |
| 203 | |
| 204 | public static int solve(int u) { |
| 205 | vis[u] = true; |
| 206 | int ans = calc(u); |
| 207 | for (int e = head[u]; e > 0; e = nxt[e]) { |
| 208 | int v = to[e]; |
| 209 | if (!vis[v]) { |
| 210 | ans = Math.min(ans, solve(getCentroid(v, u))); |
| 211 | } |
| 212 | } |
| 213 | return ans; |
| 214 | } |
| 215 | |
| 216 | public static void main(String[] args) throws Exception { |
| 217 | FastReader in = new FastReader(System.in); |
no test coverage detected