結果

問題 No.1218 Something Like a Theorem
ユーザー MottchanMottchan
提出日時 2023-03-26 19:47:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 81,536 KB
実行使用メモリ 65,976 KB
最終ジャッジ日時 2023-10-19 13:50:03
合計ジャッジ時間 1,794 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
59,632 KB
testcase_01 AC 38 ms
53,356 KB
testcase_02 AC 38 ms
53,356 KB
testcase_03 AC 38 ms
53,356 KB
testcase_04 AC 39 ms
53,356 KB
testcase_05 AC 38 ms
53,356 KB
testcase_06 AC 44 ms
59,632 KB
testcase_07 AC 57 ms
65,976 KB
testcase_08 AC 56 ms
65,976 KB
testcase_09 AC 52 ms
63,780 KB
testcase_10 AC 55 ms
63,916 KB
testcase_11 AC 44 ms
59,632 KB
testcase_12 AC 44 ms
59,632 KB
testcase_13 AC 38 ms
53,356 KB
testcase_14 AC 39 ms
53,356 KB
testcase_15 AC 39 ms
53,356 KB
testcase_16 AC 39 ms
53,356 KB
testcase_17 AC 39 ms
53,356 KB
権限があれば一括ダウンロードができます

ソースコード

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