結果

問題 No.1218 Something Like a Theorem
ユーザー mesame3993
提出日時 2021-11-18 21:23:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 484 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 82,172 KB
実行使用メモリ 224,720 KB
最終ジャッジ日時 2024-12-27 16:46:38
合計ジャッジ時間 3,133 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

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

  
  
main()
0