結果

問題 No.1218 Something Like a Theorem
ユーザー ああいい
提出日時 2022-01-10 13:39:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 82,236 KB
実行使用メモリ 53,684 KB
最終ジャッジ日時 2024-11-14 10:51:04
合計ジャッジ時間 1,880 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

n,z = map(int,input().split())
import sys
if n >= 3:
    print('No')
    exit()
if n == 1:
    if z > 1:
        print('Yes')
        exit()
    else:
        print('No')
        exit()

s =set()
for x in range(1,z):
    s.add(x * x)
for x in range(1,z):
    if z * z - x * x in s:
        print('Yes')
        exit()
print('No')

    
0