結果

問題 No.2555 Intriguing Triangle
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-12-01 18:10:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 688 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 68,576 KB
最終ジャッジ日時 2023-12-01 18:11:02
合計ジャッジ時間 2,955 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
59,640 KB
testcase_01 AC 42 ms
59,632 KB
testcase_02 AC 44 ms
59,640 KB
testcase_03 AC 43 ms
59,596 KB
testcase_04 AC 49 ms
62,212 KB
testcase_05 AC 41 ms
59,640 KB
testcase_06 AC 40 ms
59,640 KB
testcase_07 AC 44 ms
59,632 KB
testcase_08 AC 43 ms
59,632 KB
testcase_09 AC 52 ms
64,420 KB
testcase_10 AC 62 ms
68,576 KB
testcase_11 AC 52 ms
64,424 KB
testcase_12 AC 64 ms
68,568 KB
testcase_13 AC 63 ms
68,568 KB
testcase_14 AC 63 ms
68,568 KB
testcase_15 AC 49 ms
62,344 KB
testcase_16 AC 53 ms
64,412 KB
testcase_17 AC 43 ms
59,640 KB
testcase_18 AC 48 ms
62,224 KB
testcase_19 AC 41 ms
59,632 KB
testcase_20 AC 57 ms
66,472 KB
testcase_21 AC 58 ms
66,472 KB
testcase_22 AC 43 ms
59,632 KB
testcase_23 AC 43 ms
59,628 KB
testcase_24 AC 45 ms
59,596 KB
testcase_25 AC 46 ms
62,228 KB
testcase_26 AC 53 ms
64,412 KB
testcase_27 AC 49 ms
62,344 KB
testcase_28 AC 42 ms
59,640 KB
testcase_29 AC 54 ms
64,408 KB
権限があれば一括ダウンロードができます

ソースコード

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