MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / query_upto

Method query_upto

code/graph/hld.cpp:42–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 u--, v--;
41 return res; }
42 int query_upto(int u, int v) { int res = ID;
43 while (head[u] != head[v])
44 res = f(res, values.query(loc[head[u]], loc[u]).x),
45 u = parent[head[u]];
46 return f(res, values.query(loc[v] + 1, loc[u]).x); }
47 int query(int u, int v) { int l = lca(u, v);
48 return f(query_upto(u, l), query_upto(v, l)); } };
49// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls 2

fFunction · 0.85
queryMethod · 0.45

Tested by

no test coverage detected