結果

問題 No.1218 Something Like a Theorem
ユーザー tanon710tanon710
提出日時 2020-09-21 15:53:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 71,636 KB
最終ジャッジ日時 2023-09-06 17:12:36
合計ジャッジ時間 2,865 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 76 ms
71,244 KB
testcase_02 AC 73 ms
70,900 KB
testcase_03 AC 74 ms
71,236 KB
testcase_04 AC 75 ms
71,124 KB
testcase_05 AC 73 ms
71,296 KB
testcase_06 AC 74 ms
71,312 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 77 ms
71,368 KB
testcase_10 WA -
testcase_11 AC 74 ms
71,636 KB
testcase_12 WA -
testcase_13 AC 74 ms
71,296 KB
testcase_14 AC 75 ms
71,064 KB
testcase_15 AC 74 ms
71,056 KB
testcase_16 AC 73 ms
71,208 KB
testcase_17 AC 75 ms
71,336 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**2:
                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