結果

問題 No.1218 Something Like a Theorem
ユーザー mesame3993mesame3993
提出日時 2021-11-18 21:26:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 210,576 KB
最終ジャッジ日時 2023-08-27 15:43:31
合計ジャッジ時間 5,214 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 349 ms
210,456 KB
testcase_01 AC 78 ms
71,288 KB
testcase_02 AC 76 ms
71,408 KB
testcase_03 AC 77 ms
71,248 KB
testcase_04 AC 76 ms
71,092 KB
testcase_05 AC 79 ms
71,048 KB
testcase_06 AC 410 ms
210,444 KB
testcase_07 AC 336 ms
210,524 KB
testcase_08 AC 337 ms
210,380 KB
testcase_09 WA -
testcase_10 AC 331 ms
210,448 KB
testcase_11 WA -
testcase_12 AC 329 ms
210,320 KB
testcase_13 AC 79 ms
71,212 KB
testcase_14 AC 78 ms
71,168 KB
testcase_15 AC 80 ms
71,168 KB
testcase_16 AC 78 ms
71,048 KB
testcase_17 AC 77 ms
71,428 KB
権限があれば一括ダウンロードができます

ソースコード

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