結果

問題 No.1218 Something Like a Theorem
ユーザー MineMine
提出日時 2020-09-06 23:24:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 254 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 10,500 KB
実行使用メモリ 8,140 KB
最終ジャッジ日時 2023-08-19 14:32:30
合計ジャッジ時間 2,291 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
8,020 KB
testcase_01 AC 12 ms
7,744 KB
testcase_02 AC 13 ms
7,784 KB
testcase_03 AC 13 ms
7,776 KB
testcase_04 AC 12 ms
7,828 KB
testcase_05 AC 13 ms
7,796 KB
testcase_06 AC 228 ms
7,820 KB
testcase_07 AC 83 ms
8,140 KB
testcase_08 AC 103 ms
8,112 KB
testcase_09 AC 254 ms
7,728 KB
testcase_10 AC 49 ms
8,088 KB
testcase_11 AC 225 ms
7,728 KB
testcase_12 AC 14 ms
8,140 KB
testcase_13 AC 13 ms
7,808 KB
testcase_14 AC 13 ms
7,804 KB
testcase_15 AC 12 ms
7,808 KB
testcase_16 AC 12 ms
7,728 KB
testcase_17 AC 12 ms
7,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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