結果

問題 No.1218 Something Like a Theorem
ユーザー yutayuta
提出日時 2020-09-06 16:57:48
言語 Ruby
(3.3.0)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 11,524 KB
実行使用メモリ 15,308 KB
最終ジャッジ日時 2023-08-19 14:06:35
合計ジャッジ時間 2,417 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
15,152 KB
testcase_01 AC 76 ms
15,068 KB
testcase_02 AC 71 ms
15,128 KB
testcase_03 AC 70 ms
15,144 KB
testcase_04 AC 68 ms
15,212 KB
testcase_05 AC 70 ms
14,976 KB
testcase_06 AC 69 ms
15,168 KB
testcase_07 AC 100 ms
15,216 KB
testcase_08 AC 107 ms
15,308 KB
testcase_09 AC 168 ms
14,972 KB
testcase_10 AC 83 ms
15,172 KB
testcase_11 AC 69 ms
15,244 KB
testcase_12 AC 69 ms
15,176 KB
testcase_13 AC 69 ms
15,108 KB
testcase_14 AC 69 ms
15,216 KB
testcase_15 AC 68 ms
15,288 KB
testcase_16 AC 69 ms
15,236 KB
testcase_17 AC 67 ms
15,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = gets.split(' ').map(&:to_i)
if a[0] >= 3
	puts 'No'
	exit
end
if a[0] == 1
	if a[1] == 1
		puts 'No'
	else
		puts 'Yes'
	end
	exit
end
for z in 1..a[1]
	next if z == 0
	for j in 1..a[1]
		next if j == 0
		if z * z + j * j == a[1] * a[1]
			puts 'Yes'
			exit
		end
	end
end
puts 'No'
0