結果

問題 No.1218 Something Like a Theorem
ユーザー nehan_der_thalnehan_der_thal
提出日時 2020-09-04 22:13:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 156,888 KB
最終ジャッジ日時 2023-08-17 15:56:59
合計ジャッジ時間 2,838 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,324 KB
testcase_01 AC 77 ms
71,204 KB
testcase_02 AC 76 ms
70,928 KB
testcase_03 AC 78 ms
71,160 KB
testcase_04 AC 77 ms
70,996 KB
testcase_05 AC 167 ms
156,888 KB
testcase_06 AC 79 ms
71,416 KB
testcase_07 AC 77 ms
71,100 KB
testcase_08 AC 79 ms
71,172 KB
testcase_09 AC 77 ms
71,332 KB
testcase_10 AC 77 ms
71,260 KB
testcase_11 AC 77 ms
71,024 KB
testcase_12 AC 78 ms
71,076 KB
testcase_13 AC 76 ms
71,096 KB
testcase_14 AC 77 ms
71,068 KB
testcase_15 AC 77 ms
71,356 KB
testcase_16 AC 78 ms
71,356 KB
testcase_17 AC 78 ms
71,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, z = map(int, input().split())
z = z ** n
vs = set()
for x in range(1, 10**6+1):
    x = x**n
    if x > z:
        print("No")
        break
    vs.add(x)
#    print(z-x, vs)
    if z-x in vs:
        print("Yes")
        break
0