verify/AI/persistent_binary_trie_test.nim

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

:heavy_check_mark: verify/AI/persistent_binary_trie_test.nim

Depends on

Code

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

import cplib/collections/persistent_binary_trie

let t0 = initPersistentBineryTrie(3)
let t1 = t0.incl(1)
let t2 = t1.incl(4).incl(7, 2)
assert t0.count(1) == 0
assert t1.contains(1)
assert not t1.contains(4)
assert t2.count(7) == 2
assert t2.get_kth(0) == 1
assert t2.get_kth(1) == 4
assert t2.get_kth(2) == 7
assert t2.get_kth(1, 2) == 7
assert t2.lowerBound(4) == 1
assert t2.upperBound(4) == 2
let t3 = t2.excl(7)
assert t2.count(7) == 2
assert t3.count(7) == 1
let t4 = t3.set_value(4, 3)
assert t4.count(4) == 3
assert t4.RLE() == @[(1, 1), (4, 3), (7, 1)]
assert $t4 == "@[(1, 1), (4, 3), (7, 1)]"
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