結果

問題 No.1218 Something Like a Theorem
ユーザー tanon710tanon710
提出日時 2020-09-21 15:52:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 384 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 71,708 KB
最終ジャッジ日時 2023-09-06 17:12:30
合計ジャッジ時間 2,813 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,508 KB
testcase_01 AC 74 ms
71,224 KB
testcase_02 AC 77 ms
70,848 KB
testcase_03 AC 74 ms
71,076 KB
testcase_04 AC 75 ms
71,312 KB
testcase_05 AC 74 ms
71,048 KB
testcase_06 AC 74 ms
71,104 KB
testcase_07 AC 75 ms
71,212 KB
testcase_08 AC 74 ms
71,420 KB
testcase_09 AC 75 ms
71,224 KB
testcase_10 AC 77 ms
71,484 KB
testcase_11 WA -
testcase_12 AC 74 ms
71,400 KB
testcase_13 AC 75 ms
71,404 KB
testcase_14 AC 74 ms
71,344 KB
testcase_15 AC 74 ms
71,124 KB
testcase_16 AC 75 ms
71,340 KB
testcase_17 AC 73 ms
71,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def judge(z):
    for x in range(1,int(z**0.5)+1):
        for y in range(1,int(z**0.5)+1):
            if x**2+y**2==z:
                return True
    return False
    
n,z=map(int,input().split())
if n>=3:
    print('No')
elif n==1:
    if z==1:
        print('No')
    else:
        print('Yes')
elif n==2:
    if judge(z)==True:
        print('Yes')
    else:
        print('No')
0