結果

問題 No.105 arcの六角ボルト
ユーザー nbisco
提出日時 2017-01-17 23:18:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 215 ms / 5,000 ms
コード長 613 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-12-23 00:51:30
合計ジャッジ時間 964 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def str2float(x):
    thresh = 14
    if x[0] == "-":
        thresh += 1
    xs = x[0:thresh]
    if set(xs.replace("-","").replace(".","")) == set("0"):
        return 0.0
    else:
        return float(xs)

def solver():
    x0 = 0
    y0 = 0
    for i in range(6):
        x, y = map(str2float, input().split(" "))
        if (x > 0 and y >= 0) and (x > x0):
            x0 = x
            y0 = y
            if y == 0.0:
                x0 = 1.0
    return math.acos(x0)*180.0/math.pi

T = int(input())
ans = []
for i in range(T):
    input()
    ans.append(solver())

for i in ans:
    print(i)
0