結果

問題 No.1218 Something Like a Theorem
ユーザー komkompi
提出日時 2020-09-13 20:37:01
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-13 04:28:09
合計ジャッジ時間 1,307 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
n,z=map(int,input().split())

if n==1:
    if z==1:
        print("No")
    else:
        print("Yes")
    exit()

opt=[]
for num in range(1,z):
    opt.append(num**n)

ans="No"
for item in opt:
    if z**n-item in opt:
        ans="Yes"

print(ans)
0