結果

問題 No.1218 Something Like a Theorem
ユーザー stnkienstnkien
提出日時 2020-09-04 22:20:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 518 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 8,212 KB
最終ジャッジ日時 2023-08-17 16:53:06
合計ジャッジ時間 3,055 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,208 KB
testcase_01 AC 15 ms
7,896 KB
testcase_02 AC 16 ms
7,864 KB
testcase_03 AC 15 ms
7,848 KB
testcase_04 AC 15 ms
7,936 KB
testcase_05 AC 15 ms
7,860 KB
testcase_06 AC 469 ms
7,752 KB
testcase_07 AC 143 ms
8,040 KB
testcase_08 AC 182 ms
8,212 KB
testcase_09 AC 518 ms
7,948 KB
testcase_10 AC 83 ms
8,152 KB
testcase_11 AC 457 ms
7,836 KB
testcase_12 AC 17 ms
8,164 KB
testcase_13 AC 15 ms
7,836 KB
testcase_14 AC 15 ms
7,876 KB
testcase_15 AC 15 ms
7,824 KB
testcase_16 AC 15 ms
7,824 KB
testcase_17 AC 15 ms
7,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if n == 1:
    print('No' if z == 1 else 'Yes')
elif n == 2:
    for x in range(1, 2000):
        for y in range(x, 2000):
            if x*x + y*y == z*z:
                print('Yes')
                exit()
    print('No')
else:
    print('No')
0