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

Method compute

src/class185/Code04_Fantasy1.java:284–293  ·  view source on GitHub ↗
(int u)

Source from the content-addressed store, hash-verified

282 }
283
284 public static long compute(int u) {
285 long ans = query(u);
286 for (int e = head[u]; e > 0; e = nxt[e]) {
287 int v = to[e];
288 if (query(v) < ans) {
289 return compute(cent[e]);
290 }
291 }
292 return ans;
293 }
294
295 public static void main(String[] args) throws Exception {
296 FastReader in = new FastReader(System.in);

Callers 1

mainMethod · 0.95

Calls 1

queryMethod · 0.95

Tested by

no test coverage detected