Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codemistic/Data-Structures-and-Algorithms
/ preprocess
Function
preprocess
Trees/LCA.cpp:44–51 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
42
}
43
44
void preprocess(int root) {
45
tin.resize(n);
46
tout.resize(n);
47
timer = 0;
48
l = ceil(log2(n));
49
up.assign(n, vector<int>(l + 1));
50
dfs(root, root);
51
}
52
53
void solve(){
54
int q;
Callers
1
solve
Function · 0.85
Calls
1
dfs
Function · 0.70
Tested by
no test coverage detected