結果

問題 No.1218 Something Like a Theorem
ユーザー tanon710tanon710
提出日時 2020-09-21 15:53:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 86,704 KB
実行使用メモリ 75,864 KB
最終ジャッジ日時 2023-09-06 17:12:40
合計ジャッジ時間 2,944 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,072 KB
testcase_01 AC 69 ms
71,228 KB
testcase_02 AC 71 ms
71,052 KB
testcase_03 AC 71 ms
70,980 KB
testcase_04 AC 70 ms
71,216 KB
testcase_05 AC 68 ms
71,420 KB
testcase_06 AC 70 ms
71,392 KB
testcase_07 AC 83 ms
75,712 KB
testcase_08 AC 76 ms
75,864 KB
testcase_09 AC 76 ms
75,780 KB
testcase_10 AC 74 ms
75,408 KB
testcase_11 AC 69 ms
71,244 KB
testcase_12 AC 70 ms
71,356 KB
testcase_13 AC 70 ms
71,244 KB
testcase_14 AC 72 ms
71,028 KB
testcase_15 AC 71 ms
71,172 KB
testcase_16 AC 73 ms
71,152 KB
testcase_17 AC 73 ms
71,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def judge(z):
    for x in range(1,z+1):
        for y in range(1,z+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