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

Method update_cost

code/graph/hld.cpp:13–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 void add_edge(int u, int v) {
12 adj[u].push_back(v); adj[v].push_back(u); }
13 void update_cost(int u, int v, int c) {
14 if (parent[v] == u) swap(u, v); assert(parent[u] == v);
15 values.update(loc[u], c); }
16 int csz(int u) {
17 rep(i,0,size(adj[u])) if (adj[u][i] != parent[u])
18 sz[u] += csz(adj[parent[adj[u][i]] = u][i]);

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected