結果
| 問題 |
No.2954 Calculation of Exponentiation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-08 23:15:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 445 bytes |
| コンパイル時間 | 467 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 64,000 KB |
| 最終ジャッジ日時 | 2024-11-08 23:15:26 |
| 合計ジャッジ時間 | 5,588 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 WA * 5 TLE * 1 -- * 2 |
ソースコード
A,B=map(float,input().split())
import math
ga=math.gcd(int(10000*A),10000)
gb=math.gcd(int(10000*B),10000)
p=int(10000*A)//ga
q=10000//ga
r=int(10000*B)//gb
s=10000//gb
#print(p,q,r,s)
M=998244353
for n in range(p+1):
if pow(n,s,M)==p:
y=n
break
if pow(n,s,M)>p:
print("No")
exit()
for n in range(q+1):
if pow(n,s,M)==q:
x=n
break
if pow(n,s,M)>q:
print("No")
exit()
#print(y,x)
if y%x==0:
print("Yes")
else:
print("No")