結果

問題 No.105 arcの六角ボルト
ユーザー momoyuumomoyuu
提出日時 2022-08-24 01:24:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 459 ms / 5,000 ms
コード長 866 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 82,944 KB
最終ジャッジ日時 2024-04-19 15:15:58
合計ジャッジ時間 1,495 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

t = int(input())
from itertools import permutations
import math
for i in range(t):
    q = input()
    xy = [list(map(float,input().split())) for _ in range(6)]
    l = [i for i in range(6)]
    m = list(permutations(l))
    q = True
    for j in m:
        p = True
        for k in range(1,6):
            x,y = xy[j[k-1]]
            a,b = xy[j[k]]
            nx = x * math.cos(60*math.pi/180) - y * math.sin(60*math.pi/180)
            ny = x * math.sin(60*math.pi/180) + y * math.cos(60*math.pi/180)
            if (abs(nx-a)<0.1 and abs(ny-b)<0.1):
                continue
            p = False
            break
        if not p:
            continue
        th = math.atan(xy[j[0]][1]/xy[j[0]][0])
        th *= 180/math.pi
        if (0<=th<50):
            print('{:.20f}'.format(th))
            q = False
            break
    if(q):
        print(0)

0