This documentation is automatically generated by online-judge-tools/verification-helper
// verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_B
use proconio::input;
use union_find_with_potential::UnionFindWithPotential;
fn main() {
input! {
n: usize,
q: usize,
}
let mut uf = UnionFindWithPotential::<i64>::new_default(n);
for _ in 0..q {
input! { query: usize, }
match query {
0 => {
input! { x: usize, y: usize, z: i64, }
uf.merge(x, y, z);
}
1 => {
input! { x: usize, y: usize, }
if uf.same(x, y) {
println!("{}", uf.diff(x, y));
} else {
println!("?");
}
}
_ => unreachable!(),
}
}
}
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