結果

問題 No.1218 Something Like a Theorem
ユーザー mesame3993
提出日時 2021-11-18 21:26:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 1,771 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 224,512 KB
最終ジャッジ日時 2024-12-27 17:03:15
合計ジャッジ時間 5,852 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  from sys import stdin
  readline=stdin.readline
  n,z = map(int, readline().split())
  if n >= 3:
    print('No')
  elif n == 1:
    if z >= 2:
      print('Yes')
    else:
      print('No')
  elif n == 2:
    st = set(y*y for y in range(1, 10**6+1))
    z *= z
    for x in range(1, 10**6+1):
      x *- x
      if z-x in st:
        print('Yes')
        break
    else:
      print('No')
main()
0