結果

問題 No.1218 Something Like a Theorem
ユーザー qumazakiqumazaki
提出日時 2020-09-05 00:40:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 87,348 KB
実行使用メモリ 71,456 KB
最終ジャッジ日時 2023-08-17 21:01:00
合計ジャッジ時間 2,843 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,140 KB
testcase_01 AC 73 ms
71,340 KB
testcase_02 AC 78 ms
71,312 KB
testcase_03 AC 73 ms
71,456 KB
testcase_04 AC 74 ms
71,172 KB
testcase_05 AC 77 ms
71,252 KB
testcase_06 AC 77 ms
71,296 KB
testcase_07 AC 77 ms
71,448 KB
testcase_08 AC 77 ms
71,304 KB
testcase_09 AC 76 ms
71,172 KB
testcase_10 AC 76 ms
71,224 KB
testcase_11 AC 76 ms
71,176 KB
testcase_12 AC 76 ms
71,216 KB
testcase_13 AC 76 ms
71,420 KB
testcase_14 AC 74 ms
71,140 KB
testcase_15 AC 74 ms
71,392 KB
testcase_16 AC 76 ms
71,452 KB
testcase_17 AC 77 ms
71,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,z = map(int,input().split())
if(n>=3)|(z==1):
    print('No')
    exit()

x = 1
y = z-1
while(x<=y):
    zn = x**n + y**n
    if(zn == z**n):
        print('Yes')
        exit()
    elif(zn > z**n):
        y -= 1
    else:
        x += 1
print('No')
0