prog.cpp: In function 'int queryKthNode(int, int, int)':
prog.cpp:3:23: error: 'LCA' was not declared in this scope
int lca = LCA(u, v);
^
prog.cpp:4:9: error: 'depth' was not declared in this scope
if (depth[u] > depth[v]) {
^
prog.cpp:5:9: error: 'swap' is not a member of 'std'
std::swap(u ,v);
^
prog.cpp:7:9: error: 'depth' was not declared in this scope
if (depth[u] - depth[lca] > k) {
^
prog.cpp:15:27: error: 'pa' was not declared in this scope
kthNode = pa[i][u];
^
prog.cpp:17:27: error: 'pa' was not declared in this scope
kthNode = pa[i][kthNode];
^