結果

問題 No.2555 Intriguing Triangle
ユーザー nikoro256
提出日時 2023-12-02 01:06:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 770 bytes
コンパイル時間 2,153 ms
コンパイル使用メモリ 81,608 KB
実行使用メモリ 77,904 KB
最終ジャッジ日時 2024-09-26 16:09:50
合計ジャッジ時間 3,472 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22 WA * 6
権限があれば一括ダウンロードができます

ソースコード

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)
            if sinbad%p==sineac%p:
                print('Yes')
                exit(0)
print('No')
0