結果

問題 No.2555 Intriguing Triangle
ユーザー nikoro256nikoro256
提出日時 2023-12-02 01:28:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 958 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 79,768 KB
最終ジャッジ日時 2023-12-02 01:28:28
合計ジャッジ時間 3,594 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
59,504 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 36 ms
53,460 KB
testcase_06 AC 40 ms
59,472 KB
testcase_07 AC 40 ms
59,452 KB
testcase_08 AC 38 ms
53,460 KB
testcase_09 AC 38 ms
53,460 KB
testcase_10 AC 38 ms
53,460 KB
testcase_11 AC 90 ms
75,236 KB
testcase_12 AC 233 ms
77,084 KB
testcase_13 AC 45 ms
61,584 KB
testcase_14 AC 36 ms
53,460 KB
testcase_15 AC 52 ms
65,856 KB
testcase_16 AC 79 ms
75,100 KB
testcase_17 AC 39 ms
59,504 KB
testcase_18 WA -
testcase_19 AC 40 ms
59,452 KB
testcase_20 AC 36 ms
53,460 KB
testcase_21 AC 428 ms
79,768 KB
testcase_22 WA -
testcase_23 AC 36 ms
53,460 KB
testcase_24 AC 37 ms
53,460 KB
testcase_25 AC 37 ms
53,460 KB
testcase_26 AC 52 ms
65,840 KB
testcase_27 AC 77 ms
75,096 KB
testcase_28 AC 41 ms
59,472 KB
testcase_29 AC 68 ms
72,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def extgcd(a, b):
    if b:
        d, y, x = extgcd(b, a % b)
        y -= (a // b) * x
        return d, x, y
    return a, 1, 0

#以下modinv
def mod_inv(a, m):
    g, x, y = extgcd(a, m)

    if g != 1:
        raise Exception()

    if x < 0:
        x += m

    return x

a=int(input())
b=int(input())
c=int(input())
p=10**9+7
for d in range(1,201):
    for e in range(1,201):
        if b+c>a+d+e:
            cosb=(b**2+(d+a+e)**2-c**2)*mod_inv(2*b*(d+a+e),p)%p
            sinbad=d**2*(1-cosb**2)*mod_inv(b**2+d**2-2*b*d*cosb,p)
            cosc=(-b**2+(d+a+e)**2+c**2)*mod_inv(2*c*(d+a+e),p)
            sineac=e**2*(1-cosc**2)*mod_inv(c**2+e**2-2*c*e*cosc,p)
            #90度以上かの判定
            f2=(b*b+d*d-2*b*d*cosb)%p
            bool1=b*b+f2>d*d
            g2=(c*c+e*e-2*c*e*cosc)%p
            bool2=c*c+g2>e*e
            if sinbad%p==sineac%p and bool1==bool2:
                print('Yes')
                exit(0)
print('No')
0