結果

問題 No.1218 Something Like a Theorem
ユーザー brthyyjpbrthyyjp
提出日時 2020-09-04 21:26:47
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,988 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 241,392 KB
最終ジャッジ日時 2023-08-17 14:53:00
合計ジャッジ時間 8,869 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,312 KB
testcase_01 AC 94 ms
75,884 KB
testcase_02 AC 179 ms
241,392 KB
testcase_03 AC 172 ms
241,288 KB
testcase_04 AC 170 ms
241,268 KB
testcase_05 AC 167 ms
241,188 KB
testcase_06 AC 84 ms
75,624 KB
testcase_07 AC 71 ms
71,196 KB
testcase_08 AC 71 ms
71,256 KB
testcase_09 AC 87 ms
75,764 KB
testcase_10 AC 70 ms
71,312 KB
testcase_11 AC 84 ms
75,816 KB
testcase_12 AC 71 ms
71,240 KB
testcase_13 AC 88 ms
75,628 KB
testcase_14 AC 1,252 ms
76,608 KB
testcase_15 AC 1,364 ms
76,456 KB
testcase_16 AC 1,530 ms
76,208 KB
testcase_17 AC 1,988 ms
76,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,z = map(int, input().split())

S = set()
i = 1
while i**n <= 10**6:
    S.add(i**n)
    i += 1

Z = z**n
for x in range(1, 10**6+1):
    Y = Z-x**n
    if Y in S:
        print('Yes')
        exit()
else:
    print('No')
0