This documentation is automatically generated by online-judge-tools/verification-helper
View the Project on GitHub online-judge-tools/verification-helper
# verification-helper: PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/all/DSL_1_A
import sys
input = sys.stdin.buffer.readline
from examples.python.union_find import UnionFindTree
def main() -> None:
N, Q = map(int, input().split())
uft = UnionFindTree(N)
for _ in range(Q):
t, u, v = map(int, input().split())
if t == 0:
uft.unite(u, v)
else:
print(int(uft.is_same(u, v)))
if __name__ == "__main__":
main()
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.10/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 "/home/runner/.local/lib/python3.10/site-packages/onlinejudge_verify/languages/python.py", line 96, in bundle
raise NotImplementedError
NotImplementedError