結果

問題 No.105 arcの六角ボルト
ユーザー nanaenanae
提出日時 2017-02-09 23:10:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 717 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 8,428 KB
最終ジャッジ日時 2023-08-26 22:56:59
合計ジャッジ時間 1,019 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
8,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import acos, pi

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def lcm(a, b):
    return a * b // gcd(a, b)

def solve():
    T = int(input())
    eps = 10**(-12)

    for i in range(T):
        input()
        xt = -1

        for j in range(6):
            x, y = map(float, input().split())

            if y >= -eps and x >= -eps:
                xt = max(x, xt)

        if abs(xt - 1) <= eps:
            xt = 1.0
        elif abs(xt) <= eps:
            xt = 0.0

        ans = acos(xt) / pi * 180.0

        print(ans)



if __name__ == '__main__':
    solve()
0