結果

問題 No.1218 Something Like a Theorem
ユーザー 👑 Kazun
提出日時 2020-09-04 21:35:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 297 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 744,384 KB
最終ジャッジ日時 2024-11-26 12:08:42
合計ジャッジ時間 5,613 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11 WA * 3 TLE * 1 MLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt

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

if n>=3:
    print("No")
    exit()
elif n==1 and z==1:
    print("No")
elif n==1 and z>=2:
    print("Yes")

X=[]
x=1
while x*x<z*z:
    X.append(x*x)
    x+=1

D=[a+b for a in X for b in X]

if z*z in D:
    print("Yes")
else:
    print("No")
0