MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / solve

Method solve

src/class183/Code03_Race1.java:204–214  ·  view source on GitHub ↗
(int u)

Source from the content-addressed store, hash-verified

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);

Callers 1

mainMethod · 0.95

Calls 2

calcMethod · 0.95
getCentroidMethod · 0.95

Tested by

no test coverage detected