結果

問題 No.1218 Something Like a Theorem
ユーザー 👑 KazunKazun
提出日時 2020-09-04 21:40:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 149,964 KB
最終ジャッジ日時 2023-08-17 15:13:23
合計ジャッジ時間 2,891 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
149,864 KB
testcase_01 AC 70 ms
71,004 KB
testcase_02 AC 72 ms
71,572 KB
testcase_03 AC 75 ms
71,396 KB
testcase_04 AC 71 ms
71,084 KB
testcase_05 AC 71 ms
71,228 KB
testcase_06 AC 119 ms
149,848 KB
testcase_07 AC 118 ms
149,896 KB
testcase_08 AC 118 ms
149,704 KB
testcase_09 AC 122 ms
149,956 KB
testcase_10 AC 120 ms
149,712 KB
testcase_11 AC 120 ms
149,748 KB
testcase_12 AC 119 ms
149,964 KB
testcase_13 AC 71 ms
71,488 KB
testcase_14 AC 70 ms
71,172 KB
testcase_15 AC 71 ms
71,264 KB
testcase_16 AC 72 ms
71,116 KB
testcase_17 AC 73 ms
71,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt

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

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

X=[x*x for x in range(1,10**3+1)]
Y=[a+b for a in X for b in X]

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