結果
| 問題 |
No.2555 Intriguing Triangle
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2023-12-02 01:04:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 770 bytes |
| コンパイル時間 | 519 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 78,140 KB |
| 最終ジャッジ日時 | 2024-09-26 16:08:58 |
| 合計ジャッジ時間 | 3,332 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 WA * 6 |
ソースコード
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')
nikoro256