結果
問題 | No.2555 Intriguing Triangle |
ユーザー |
👑 ![]() |
提出日時 | 2023-12-01 02:41:14 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 436 ms / 2,000 ms |
コード長 | 796 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 11,392 KB |
最終ジャッジ日時 | 2024-09-26 15:30:35 |
合計ジャッジ時間 | 2,658 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 28 |
ソースコード
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()