結果

問題 No.1218 Something Like a Theorem
ユーザー aqua_tenhouaqua_tenhou
提出日時 2020-09-04 21:26:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 76,456 KB
最終ジャッジ日時 2023-08-17 14:52:16
合計ジャッジ時間 2,501 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
76,288 KB
testcase_01 AC 69 ms
71,380 KB
testcase_02 AC 69 ms
71,588 KB
testcase_03 AC 69 ms
71,208 KB
testcase_04 AC 72 ms
71,240 KB
testcase_05 AC 69 ms
71,276 KB
testcase_06 AC 75 ms
76,044 KB
testcase_07 AC 80 ms
76,432 KB
testcase_08 AC 79 ms
76,324 KB
testcase_09 AC 76 ms
76,324 KB
testcase_10 AC 80 ms
76,456 KB
testcase_11 AC 77 ms
76,060 KB
testcase_12 AC 77 ms
76,308 KB
testcase_13 AC 68 ms
71,084 KB
testcase_14 AC 68 ms
71,084 KB
testcase_15 AC 70 ms
71,048 KB
testcase_16 AC 68 ms
71,252 KB
testcase_17 AC 67 ms
71,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,z = map(int,input().split())
if n >= 3:
    print("No")
elif n == 1:
    if z >= 2:
        print("Yes")
    else:
        print("No")
else:
    ans = 0
    for x in range(1,1001):
        for y in range(1,1001):
            if x**2 + y**2 == z**2:
                ans = 1
                break
                
    print(["No","Yes"][ans])
0