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

Method add_edge

code/graph/hld.cpp:11–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9 parent(n, -1), loc(n), adj(n) {
10 vector<ll> tmp(n, ID); values = segment_tree(tmp); }
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); }

Callers 13

test_randFunction · 0.45
testFunction · 0.45
iterFunction · 0.45
test1Function · 0.45
test2Function · 0.45
test3Function · 0.45
testFunction · 0.45
test1Function · 0.45
test2Function · 0.45
test3Function · 0.45
testFunction · 0.45
test_randFunction · 0.45

Calls 1

push_backMethod · 0.80

Tested by 13

test_randFunction · 0.36
testFunction · 0.36
iterFunction · 0.36
test1Function · 0.36
test2Function · 0.36
test3Function · 0.36
testFunction · 0.36
test1Function · 0.36
test2Function · 0.36
test3Function · 0.36
testFunction · 0.36
test_randFunction · 0.36