結果

問題 No.172 UFOを捕まえろ
ユーザー lloyzlloyz
提出日時 2023-05-28 01:11:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 387 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 76,432 KB
最終ジャッジ日時 2023-08-27 02:01:15
合計ジャッジ時間 3,553 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
76,192 KB
testcase_01 AC 69 ms
71,396 KB
testcase_02 AC 73 ms
75,844 KB
testcase_03 AC 72 ms
76,016 KB
testcase_04 AC 69 ms
71,412 KB
testcase_05 AC 74 ms
76,432 KB
testcase_06 AC 73 ms
76,192 KB
testcase_07 AC 71 ms
75,912 KB
testcase_08 AC 71 ms
75,848 KB
testcase_09 AC 72 ms
76,060 KB
testcase_10 AC 76 ms
76,204 KB
testcase_11 AC 68 ms
71,296 KB
testcase_12 AC 66 ms
71,124 KB
testcase_13 AC 66 ms
71,300 KB
testcase_14 AC 76 ms
76,236 KB
testcase_15 AC 75 ms
76,072 KB
testcase_16 AC 74 ms
76,236 KB
testcase_17 AC 72 ms
76,072 KB
testcase_18 AC 73 ms
76,052 KB
testcase_19 AC 74 ms
76,176 KB
testcase_20 AC 69 ms
71,604 KB
testcase_21 AC 78 ms
76,348 KB
testcase_22 AC 74 ms
76,284 KB
testcase_23 AC 71 ms
75,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x, y, r = map(int, input().split())

for c in range(abs(x) + abs(y), 401):
    flag = True
    for xx in range(-c, c + 1):
        yy = c - abs(xx)
        if (xx - x)**2 + (yy - y)**2 <= r**2:
            flag = False
            break
        yy *= -1
        if (xx - x)**2 + (yy - y)**2 <= r**2:
            flag = False
            break
    if flag:
        print(c)
        break
0