結果

問題 No.2555 Intriguing Triangle
ユーザー 👑 amentorimaruamentorimaru
提出日時 2023-12-01 02:41:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 388 ms / 2,000 ms
コード長 796 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2023-12-01 13:41:26
合計ジャッジ時間 2,800 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
10,624 KB
testcase_01 AC 40 ms
10,624 KB
testcase_02 AC 37 ms
10,624 KB
testcase_03 AC 38 ms
10,624 KB
testcase_04 AC 45 ms
10,624 KB
testcase_05 AC 35 ms
10,624 KB
testcase_06 AC 35 ms
10,624 KB
testcase_07 AC 37 ms
10,624 KB
testcase_08 AC 35 ms
10,624 KB
testcase_09 AC 42 ms
10,624 KB
testcase_10 AC 57 ms
10,624 KB
testcase_11 AC 40 ms
10,624 KB
testcase_12 AC 79 ms
10,624 KB
testcase_13 AC 44 ms
10,624 KB
testcase_14 AC 60 ms
10,624 KB
testcase_15 AC 36 ms
10,624 KB
testcase_16 AC 38 ms
10,624 KB
testcase_17 AC 32 ms
10,624 KB
testcase_18 AC 42 ms
10,624 KB
testcase_19 AC 36 ms
10,624 KB
testcase_20 AC 36 ms
10,624 KB
testcase_21 AC 388 ms
10,624 KB
testcase_22 AC 37 ms
10,624 KB
testcase_23 AC 37 ms
10,624 KB
testcase_24 AC 36 ms
10,624 KB
testcase_25 AC 37 ms
10,624 KB
testcase_26 AC 37 ms
10,624 KB
testcase_27 AC 40 ms
10,624 KB
testcase_28 AC 36 ms
10,624 KB
testcase_29 AC 40 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from fractions import Fraction
input = sys.stdin.readline
def read_values(): return tuple(map(int, input().split()))
def read_list(): return list(map(int, input().split()))

def main():  
    a=int(input())
    b=int(input())
    c=int(input())
    for x in range(1,300):
        for y in range(1,300):   
            aa = a+x+y
            if aa>=b+c:
                break
            if b >= aa+c or c >= aa+b:
                continue
            cosb=Fraction(b*b+aa*aa-c*c,2*b*aa)
            cosc=Fraction(c*c+aa*aa-b*b,2*c*aa)
            d2 = c*c+(a+y)*(a+y)-2*c*(a+y)*cosc
            e2 = b*b+(a+x)*(a+x)-2*b*(a+x)*cosb
            if x*x*c*c*e2==b*b*d2*y*y:
                print("Yes")
                return
    print("No")
        
if __name__ == "__main__":
    main()
0