結果

問題 No.2954 Calculation of Exponentiation
ユーザー ニックネーム
提出日時 2024-11-08 22:31:44
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 735 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-08 22:31:56
合計ジャッジ時間 2,396 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
a,b = input().split()
if b==0: exit(print("Yes"))
a = int(a[:-5]+a[-4:]); b = int(b[:-5]+b[-4:]); c = d = 10000
e = gcd(a,c); f = gcd(b,d); a //= e; b //= f; c //= e; d //= f
if b<0: a,c = c,a
if c>1: exit(print("No"))
for i in range(1,a+1):
    if i**d==a: exit(print("Yes"))
    if i**d>a: break
print("No")
0