結果

問題 No.1218 Something Like a Theorem
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-12-01 08:04:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 62,464 KB
最終ジャッジ日時 2024-04-16 23:52:40
合計ジャッジ時間 2,379 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
61,056 KB
testcase_01 AC 53 ms
55,424 KB
testcase_02 AC 55 ms
55,296 KB
testcase_03 AC 53 ms
55,168 KB
testcase_04 AC 53 ms
54,912 KB
testcase_05 AC 52 ms
55,680 KB
testcase_06 AC 63 ms
62,336 KB
testcase_07 AC 62 ms
62,464 KB
testcase_08 AC 62 ms
62,080 KB
testcase_09 AC 62 ms
62,080 KB
testcase_10 AC 59 ms
61,312 KB
testcase_11 AC 63 ms
62,336 KB
testcase_12 AC 60 ms
61,312 KB
testcase_13 AC 54 ms
55,168 KB
testcase_14 AC 55 ms
55,424 KB
testcase_15 AC 55 ms
55,424 KB
testcase_16 AC 55 ms
55,168 KB
testcase_17 AC 53 ms
54,912 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