AtCoder-Library

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

View the Project on GitHub ryusuke920/AtCoder-Library

:warning: Geometry/SharedPoint.py

Code

def SharedPoint(x1: int, y1: int, r1: int, x2: int, y2: int, r2: int) -> int:
    """2つの円の共有点の個数を求める"""
    # (x1, y1) を中心とした半径 r1 の円
    # (x - x1) ** 2 + (y - y1) ** 2 = r1 ** 2
    d = (x1 - x2) ** 2 + (y1 - y2) ** 2
    
    # r1 > r2
    if r1 < r2:
        r1, r2 = r2, r1
    
    if d == (r1 + r2) ** 2 or d == (r1 - r2) ** 2:
        return 1
    elif (r1 - r2) ** 2 < d < (r1 + r2) ** 2:
        return 2
    else:
        return 0

'''
類題
ABC259-D - Circumferences: https://atcoder.jp/contests/abc259/tasks/abc259_d
ACコード: https://atcoder.jp/contests/abc259/submissions/33150317
'''
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.5/x64/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 "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py", line 96, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page