結果

問題 No.1218 Something Like a Theorem
ユーザー Mottchan
提出日時 2023-03-26 19:46:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 444 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 64,896 KB
最終ジャッジ日時 2024-09-19 09:57:58
合計ジャッジ時間 1,586 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

n,z=map(int,input().split())
a=0
if n == 1:
    if z==1:
        print('No')
    else:
        print('Yes')
        
elif n == 2:
    for x in range(1,10**4):
        for y in range(x,10**4):
            if x ** n + y ** n == z ** n:
                a+=1
                break        
            elif x ** n + y ** n > z ** n:
                break

    if a > 0:
        print('Yes')
    else:
        print('No')
elif n == 3:
    print('No')
0