結果

問題 No.172 UFOを捕まえろ
コンテスト
ユーザー weaken
提出日時 2021-10-18 22:07:35
言語 Python3
(3.14.2 + numpy 2.4.0 + scipy 1.16.3)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 418 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 134 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-19 18:39:47
合計ジャッジ時間 1,493 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math


def pos(x, y, r, degree):
    rad = math.radians(degree)
    return (r * math.cos(rad) + x, r * math.sin(rad) + y)


def main():
    x, y, r = map(int, input().split())
    # first quadrant
    x, y = pos(abs(x), abs(y), r, 45)

    manhattan = 0
    for r in range(1, 500):
        if y < -x + r:
            manhattan = r
            break

    print(manhattan)


if __name__ == "__main__":
    main()
0