結果

問題 No.2555 Intriguing Triangle
ユーザー nikoro256nikoro256
提出日時 2023-12-02 01:04:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 770 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 78,108 KB
最終ジャッジ日時 2023-12-02 01:04:27
合計ジャッジ時間 3,714 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
59,384 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 39 ms
53,460 KB
testcase_06 AC 42 ms
59,376 KB
testcase_07 AC 42 ms
59,324 KB
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 38 ms
53,460 KB
testcase_10 AC 38 ms
53,460 KB
testcase_11 AC 95 ms
75,240 KB
testcase_12 AC 214 ms
76,896 KB
testcase_13 AC 45 ms
61,584 KB
testcase_14 AC 38 ms
53,460 KB
testcase_15 AC 53 ms
65,856 KB
testcase_16 AC 80 ms
75,104 KB
testcase_17 AC 40 ms
59,384 KB
testcase_18 WA -
testcase_19 AC 41 ms
59,324 KB
testcase_20 AC 37 ms
53,460 KB
testcase_21 AC 341 ms
78,108 KB
testcase_22 WA -
testcase_23 AC 38 ms
53,460 KB
testcase_24 AC 37 ms
53,460 KB
testcase_25 AC 39 ms
53,460 KB
testcase_26 AC 56 ms
65,840 KB
testcase_27 AC 74 ms
73,560 KB
testcase_28 AC 42 ms
59,344 KB
testcase_29 AC 67 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,101):
    for e in range(1,101):
        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