結果

問題 No.1218 Something Like a Theorem
ユーザー chielochielo
提出日時 2020-09-04 21:25:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 86,880 KB
実行使用メモリ 76,800 KB
最終ジャッジ日時 2023-08-17 14:48:32
合計ジャッジ時間 2,612 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,460 KB
testcase_01 AC 76 ms
71,652 KB
testcase_02 AC 73 ms
71,152 KB
testcase_03 AC 74 ms
71,100 KB
testcase_04 AC 72 ms
70,928 KB
testcase_05 AC 73 ms
71,072 KB
testcase_06 AC 71 ms
71,372 KB
testcase_07 AC 109 ms
76,564 KB
testcase_08 AC 78 ms
76,800 KB
testcase_09 AC 79 ms
76,760 KB
testcase_10 AC 73 ms
71,432 KB
testcase_11 AC 72 ms
71,248 KB
testcase_12 AC 72 ms
71,804 KB
testcase_13 AC 73 ms
71,688 KB
testcase_14 AC 70 ms
71,716 KB
testcase_15 AC 72 ms
71,808 KB
testcase_16 AC 72 ms
71,264 KB
testcase_17 AC 71 ms
71,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, z = map(int, input().split())
for x in range(1, min(z, 10 ** 6) + 1):
    yt = (z ** n - x ** n) ** (1. / n)
    for y in range(max(1, int(yt) - 2), int(yt) + 3):
        if x ** n + y ** n == z ** n:
            print('Yes')
            exit()
print('No')
0