結果

問題 No.1218 Something Like a Theorem
ユーザー Mine
提出日時 2020-09-06 23:24:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 369 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-29 07:52:52
合計ジャッジ時間 2,567 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

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