結果

問題 No.1556 Power Equality
ユーザー U SU S
提出日時 2021-06-25 21:40:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 550 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 73,348 KB
最終ジャッジ日時 2023-09-07 15:52:11
合計ジャッジ時間 2,377 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
73,168 KB
testcase_01 AC 113 ms
73,004 KB
testcase_02 AC 110 ms
73,168 KB
testcase_03 AC 109 ms
73,092 KB
testcase_04 AC 108 ms
73,268 KB
testcase_05 AC 110 ms
73,348 KB
testcase_06 AC 109 ms
73,276 KB
testcase_07 AC 109 ms
73,012 KB
testcase_08 AC 109 ms
72,860 KB
testcase_09 AC 111 ms
73,008 KB
testcase_10 AC 110 ms
73,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys
# input = sys.stdin.readline
def mp():return map(int,input().split())
def lmp():return list(map(int,input().split()))
import math
import bisect
from copy import deepcopy as dc
from itertools import accumulate
from collections import Counter, defaultdict, deque
def ceil(U,V):return (U+V-1)//V
def modf1(N,MOD):return (N-1)%MOD+1
inf = int(1e30)
mod = 998244353

a,b = mp()
if a > b:a,b = b,a
for i in range(60):
    u = a**i
    if u == b:
        if i*a == b:
            print("Yes")
            exit()
    elif u > b:break
print("No")
0