結果

問題 No.98 円を描こう
ユーザー 村上史弥村上史弥
提出日時 2022-11-10 19:19:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,560 KB
実行使用メモリ 8,060 KB
最終ジャッジ日時 2023-10-01 03:17:29
合計ジャッジ時間 992 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,916 KB
testcase_01 AC 16 ms
7,896 KB
testcase_02 AC 16 ms
8,032 KB
testcase_03 AC 15 ms
7,816 KB
testcase_04 AC 15 ms
7,920 KB
testcase_05 AC 14 ms
8,060 KB
testcase_06 AC 15 ms
7,968 KB
testcase_07 AC 15 ms
7,928 KB
testcase_08 AC 15 ms
7,912 KB
testcase_09 AC 15 ms
7,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
X = input().split()
Xp = abs(int(X[0]))
Yp = abs(int(X[1]))
if Xp == Yp == 0:
    print(1)
elif Xp == 0:
    ans = Yp * 2 + 1
    print(ans)
elif Yp == 0:
    ans = Xp * 2 + 1
    print(ans)
else:
    length = math.sqrt(Xp ** 2 + Yp ** 2)
    ans = length * 2 + 1
    print(int(ans))
0