This documentation is automatically generated by online-judge-tools/verification-helper
// verification-helper: PROBLEM https://judge.yosupo.jp/problem/lca
use proconio::input;
use euler_tour::EulerTour;
fn main() {
std::thread::Builder::new()
.stack_size(64 * 1024 * 1024)
.spawn(actual_main)
.unwrap()
.join()
.unwrap();
}
fn actual_main() {
input! {
n: usize,
q: usize,
p: [usize; n - 1],
uv: [(usize, usize); q],
}
let mut et = EulerTour::<usize>::new(n);
for (i, &p) in p.iter().enumerate() {
et.add_edge(i + 1, p, 0);
et.add_edge(p, i + 1, 0);
}
et.init(0);
for (u, v) in uv {
println!("{}", et.lca(u, v));
}
}
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/onlinejudge_verify/documentation/build.py", line 71, in _render_source_code_stat
bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/onlinejudge_verify/languages/rust.py", line 288, in bundle
raise NotImplementedError
NotImplementedError