結果

問題 No.98 円を描こう
ユーザー kichirb3kichirb3
提出日時 2018-03-05 23:27:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 469 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 8,068 KB
最終ジャッジ日時 2023-10-11 20:34:59
合計ジャッジ時間 1,015 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,968 KB
testcase_01 AC 17 ms
7,888 KB
testcase_02 AC 16 ms
7,972 KB
testcase_03 AC 16 ms
7,948 KB
testcase_04 AC 16 ms
7,908 KB
testcase_05 AC 17 ms
7,944 KB
testcase_06 AC 16 ms
7,940 KB
testcase_07 AC 16 ms
8,068 KB
testcase_08 AC 17 ms
7,972 KB
testcase_09 AC 16 ms
7,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.98 円を描こう
https://yukicoder.me/problems/no/98

"""
import sys
from sys import stdin
from math import ceil
input = stdin.readline


def solve(xp, yp):
    r = (xp**2 + yp**2)**0.5
    d = r * 2
    ans = ceil(d)
    if ((ans/2)**2 == xp**2 + yp**2):
        ans += 1
    return ans


def main(args):
    xp, yp = map(int, input().split())
    ans = solve(xp, yp)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
0