結果

問題 No.1218 Something Like a Theorem
ユーザー tikitaka1201tikitaka1201
提出日時 2020-10-03 11:51:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 76,488 KB
最終ジャッジ日時 2023-09-25 05:00:49
合計ジャッジ時間 3,287 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,240 KB
testcase_01 AC 77 ms
75,896 KB
testcase_02 AC 70 ms
71,344 KB
testcase_03 AC 70 ms
71,536 KB
testcase_04 AC 71 ms
71,384 KB
testcase_05 AC 72 ms
71,152 KB
testcase_06 AC 75 ms
71,200 KB
testcase_07 AC 77 ms
76,488 KB
testcase_08 AC 79 ms
76,416 KB
testcase_09 AC 79 ms
76,036 KB
testcase_10 AC 75 ms
75,772 KB
testcase_11 AC 72 ms
71,352 KB
testcase_12 AC 72 ms
71,516 KB
testcase_13 AC 74 ms
71,060 KB
testcase_14 AC 75 ms
71,444 KB
testcase_15 AC 81 ms
71,800 KB
testcase_16 AC 80 ms
71,704 KB
testcase_17 AC 80 ms
71,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
def MI():
    return map(int, input().split())

n,z= MI()

if n==1:
    if z>1: print('Yes')
    else: print('No')
    exit()
zn=z**n

for x in range(1,10**3+1):
    for y in range(x, 10**3+1):
        if x**n+y**n==zn:
            print('Yes')
            exit()
        if x**n+y**n>z**n:
            break
print('No')
0