Skip to content

Commit

Permalink
golf
Browse files Browse the repository at this point in the history
  • Loading branch information
lrvideckis committed Dec 17, 2024
1 parent bbfaefb commit fa4dc3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/graph/HLD.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ template <bool VALS_EDGES> struct HLD {
: N(sz(adj_)), adj(adj_), par(N, -1), siz(N, 1),
rt(N),pos(N),tree(new Node(0, N)){ dfsSz(0); dfsHld(0); }
void dfsSz(int v) {
if (par[v] != -1) adj[v].erase(find(all(adj[v]), par[v]));
for (int& u : adj[v]) {
adj[u].erase(find(all(adj[u]), v));
par[u] = v;
dfsSz(u);
siz[v] += siz[u];
Expand Down

0 comments on commit fa4dc3a

Please sign in to comment.