結果

問題 No.2555 Intriguing Triangle
ユーザー Nikkuniku029
提出日時 2023-12-01 18:10:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 688 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 68,480 KB
最終ジャッジ日時 2024-09-26 15:47:07
合計ジャッジ時間 2,486 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

a = int(input())
b = int(input())
c = int(input())
ans = "No"
for x in range(1, 200):
    for y in range(1, 200):
        z = x + y + a
        if not z < b + c:
            continue
        if not b < c + z:
            continue
        if not c < b + z:
            continue
        cosB = (b**2 + z**2 - c**2) / (2 * b * z)
        p = (b**2 + x**2 - 2 * b * x * cosB) ** 0.5
        costheta = (b**2 + p**2 - x**2) / (2 * b * p)
        cosC = (c**2 + z**2 - b**2) / (2 * c * z)
        q = (c**2 + y**2 - 2 * c * y * cosC) ** 0.5
        cosphi = (c**2 + q**2 - y**2) / (2 * c * q)
        EPS = 10 ** (-6)
        if abs(costheta - cosphi) < EPS:
            ans = "Yes"
print(ans)
0