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

Method csz

code/graph/hld.cpp:16–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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]);
19 return sz[u]; }
20 void part(int u) {
21 head[u] = curhead; loc[u] = curloc++;
22 int best = -1;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected