結果

問題 No.1218 Something Like a Theorem
ユーザー ああいいああいい
提出日時 2022-01-10 13:39:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 82,072 KB
実行使用メモリ 53,536 KB
最終ジャッジ日時 2024-04-26 20:05:22
合計ジャッジ時間 1,556 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,248 KB
testcase_01 AC 39 ms
51,968 KB
testcase_02 AC 38 ms
52,364 KB
testcase_03 AC 39 ms
51,520 KB
testcase_04 AC 38 ms
53,136 KB
testcase_05 AC 37 ms
52,908 KB
testcase_06 AC 39 ms
52,348 KB
testcase_07 AC 38 ms
52,448 KB
testcase_08 AC 39 ms
53,536 KB
testcase_09 AC 38 ms
53,224 KB
testcase_10 AC 39 ms
53,148 KB
testcase_11 AC 38 ms
52,084 KB
testcase_12 AC 39 ms
53,052 KB
testcase_13 AC 38 ms
53,424 KB
testcase_14 AC 39 ms
52,496 KB
testcase_15 AC 37 ms
52,124 KB
testcase_16 AC 38 ms
52,500 KB
testcase_17 AC 38 ms
51,940 KB
権限があれば一括ダウンロードができます

ソースコード

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