結果

問題 No.1218 Something Like a Theorem
ユーザー brthyyjpbrthyyjp
提出日時 2020-09-04 21:28:58
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 193 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 1,399 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 257,620 KB
最終ジャッジ日時 2023-08-17 14:58:26
合計ジャッジ時間 4,088 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,284 KB
testcase_01 AC 72 ms
70,932 KB
testcase_02 AC 193 ms
257,620 KB
testcase_03 AC 176 ms
257,068 KB
testcase_04 AC 178 ms
256,932 KB
testcase_05 AC 184 ms
257,428 KB
testcase_06 AC 73 ms
71,064 KB
testcase_07 AC 73 ms
71,168 KB
testcase_08 AC 74 ms
71,276 KB
testcase_09 AC 73 ms
71,304 KB
testcase_10 AC 73 ms
71,284 KB
testcase_11 AC 72 ms
71,032 KB
testcase_12 AC 73 ms
71,200 KB
testcase_13 AC 73 ms
71,220 KB
testcase_14 AC 72 ms
71,156 KB
testcase_15 AC 72 ms
71,164 KB
testcase_16 AC 70 ms
70,828 KB
testcase_17 AC 71 ms
70,960 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
L = list(S)
for X in L:
    Y = Z-X
    if Y in S:
        print('Yes')
        exit()
else:
    print('No')
0