結果

問題 No.2555 Intriguing Triangle
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-12-01 18:09:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 700 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 70,748 KB
最終ジャッジ日時 2023-12-01 18:09:13
合計ジャッジ時間 3,024 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,588 KB
testcase_01 AC 37 ms
53,588 KB
testcase_02 AC 37 ms
53,588 KB
testcase_03 AC 43 ms
59,576 KB
testcase_04 AC 42 ms
59,572 KB
testcase_05 AC 36 ms
53,588 KB
testcase_06 AC 36 ms
53,588 KB
testcase_07 AC 36 ms
53,588 KB
testcase_08 AC 36 ms
53,588 KB
testcase_09 AC 48 ms
62,308 KB
testcase_10 AC 65 ms
70,604 KB
testcase_11 AC 54 ms
66,476 KB
testcase_12 AC 54 ms
66,476 KB
testcase_13 AC 60 ms
68,700 KB
testcase_14 AC 63 ms
70,748 KB
testcase_15 AC 52 ms
64,404 KB
testcase_16 AC 49 ms
64,276 KB
testcase_17 AC 36 ms
53,588 KB
testcase_18 AC 42 ms
59,576 KB
testcase_19 AC 36 ms
53,588 KB
testcase_20 AC 54 ms
66,472 KB
testcase_21 WA -
testcase_22 AC 37 ms
53,588 KB
testcase_23 AC 37 ms
53,588 KB
testcase_24 AC 42 ms
59,832 KB
testcase_25 AC 46 ms
62,208 KB
testcase_26 AC 49 ms
62,204 KB
testcase_27 AC 52 ms
64,408 KB
testcase_28 AC 39 ms
59,640 KB
testcase_29 AC 52 ms
64,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a = int(input())
b = int(input())
c = int(input())
ans = "No"
for x in range(1, b + c + 1):
    for y in range(1, b + c + 1):
        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 ** (-5)
        if abs(costheta - cosphi) < EPS:
            ans = "Yes"
print(ans)
0