library

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

View the Project on GitHub rainbou-kpr/library

:heavy_check_mark: py/sqrt.py

Verified with

Code

def isqrt(n: int) -> int:
    """
    floor(sqrt(n))
    :param int n: 平方根を求めたい非負整数
    :rtype: int
    """
    # python3.8以上ではmath.isqrtを推奨
    le = 0
    ri = 1
    while n >= ri*ri:
        ri <<= 1
    le = ri // 2
    while ri-le > 1:
        mid = (le+ri)//2
        if mid*mid <= n:
            le = mid
        else:
            ri = mid
    return le
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/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.8.18/x64/lib/python3.8/site-packages/onlinejudge_verify/languages/python.py", line 93, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page