verify/AI/binary_search_test.nim

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

:heavy_check_mark: verify/AI/binary_search_test.nim

Depends on

Code

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

import cplib/utils/binary_search

assert meguru_bisect(0, 10, proc(x: int): bool = x * x <= 30) == 5
let root2 = meguru_bisect(0.0, 2.0, proc(x: float): bool = x * x <= 2.0, 1e-12)
assert abs(root2 * root2 - 2.0) < 1e-9
let negRoot2 = meguru_bisect(-2.0, -1.0, proc(x: float): bool = x * x >= 2.0, 1e-12)
assert abs(negRoot2 * negRoot2 - 2.0) < 1e-9
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