結果

問題 No.98 円を描こう
ユーザー rihitorihito
提出日時 2018-09-17 18:56:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 386 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 10,604 KB
実行使用メモリ 7,992 KB
最終ジャッジ日時 2023-09-25 09:32:40
合計ジャッジ時間 1,135 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,868 KB
testcase_01 AC 16 ms
7,908 KB
testcase_02 AC 16 ms
7,880 KB
testcase_03 AC 16 ms
7,860 KB
testcase_04 AC 16 ms
7,832 KB
testcase_05 AC 16 ms
7,904 KB
testcase_06 AC 15 ms
7,912 KB
testcase_07 AC 15 ms
7,992 KB
testcase_08 AC 16 ms
7,864 KB
testcase_09 AC 15 ms
7,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 三平方の定理で直線の距離を求めるには、平方根の計算が必要。 → import mathでsqrt必要

import math
Xp, Yp = map(int, input().split())

#点Pまでの距離Lを求める
L = math.sqrt(Xp*Xp + Yp*Yp)

#描ける円の最小の直径Rは2Lより+1大きければ良い。
#int(2L)とすれば、整数部分のみ取り出せる。

print(int(2*L) + 1)
0