結果

問題 No.1218 Something Like a Theorem
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-12-01 08:04:06
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 87,316 KB
実行使用メモリ 78,208 KB
最終ジャッジ日時 2023-07-29 21:21:59
合計ジャッジ時間 3,870 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
77,472 KB
testcase_01 AC 104 ms
72,968 KB
testcase_02 AC 103 ms
72,808 KB
testcase_03 AC 106 ms
72,988 KB
testcase_04 AC 104 ms
72,800 KB
testcase_05 AC 105 ms
73,048 KB
testcase_06 AC 113 ms
78,208 KB
testcase_07 AC 109 ms
78,060 KB
testcase_08 AC 112 ms
78,180 KB
testcase_09 AC 113 ms
77,940 KB
testcase_10 AC 108 ms
77,492 KB
testcase_11 AC 114 ms
78,092 KB
testcase_12 AC 109 ms
77,364 KB
testcase_13 AC 104 ms
72,800 KB
testcase_14 AC 105 ms
73,024 KB
testcase_15 AC 104 ms
72,964 KB
testcase_16 AC 104 ms
73,156 KB
testcase_17 AC 105 ms
72,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from functools import *
from itertools import *
from heapq import *
import sys,math
input = sys.stdin.readline

n,z = map(int,input().split())
if n>=3:
    print('No')
    exit()

if n==1:
    if z>=2:
        print('Yes')
    else:
        print('No')
    exit()

for i in range(1,1001):
    for j in range(1,1001):
        if i**2+j**2==z**2:
            print('Yes')
            exit()
print('No')
0