verify/AI/rollback_unionfind_test.nim

This documentation is automatically generated by online-judge-tools/verification-helper

:heavy_check_mark: verify/AI/rollback_unionfind_test.nim

Depends on

Code

# verification-helper: PROBLEM https://onlinejudge.u-aizu.ac.jp/problems/ITP1_1_A
echo "Hello World"

import cplib/collections/rollback_unionfind

var uf = initRollbackUnionFind(4)
assert uf.count == 4
assert uf.get_state == 0
assert uf.unite(0, 1)
assert uf.issame(0, 1)
assert uf.siz(0) == 2
let state1 = uf.get_state
uf.snapshot()
assert uf.unite(2, 3)
assert uf.count == 4
assert uf.issame(2, 3)
uf.rollback()
assert uf.get_state == state1
assert not uf.issame(2, 3)
uf.unite(1, 2)
assert uf.issame(0, 2)
uf.undo()
assert not uf.issame(0, 2)
uf.clear_snapshot()
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.12/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.12/site-packages/onlinejudge_verify/languages/nim.py", line 86, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page