結果

問題 No.1218 Something Like a Theorem
ユーザー yutayuta
提出日時 2020-09-06 16:52:44
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 280 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-05-06 21:14:31
合計ジャッジ時間 2,492 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
12,288 KB
testcase_01 AC 80 ms
12,160 KB
testcase_02 AC 78 ms
12,160 KB
testcase_03 AC 82 ms
12,160 KB
testcase_04 AC 79 ms
12,160 KB
testcase_05 AC 83 ms
12,160 KB
testcase_06 AC 77 ms
12,288 KB
testcase_07 AC 80 ms
12,288 KB
testcase_08 AC 81 ms
12,160 KB
testcase_09 AC 192 ms
12,160 KB
testcase_10 AC 83 ms
12,160 KB
testcase_11 WA -
testcase_12 AC 79 ms
12,288 KB
testcase_13 AC 83 ms
12,288 KB
testcase_14 AC 81 ms
12,160 KB
testcase_15 AC 77 ms
12,288 KB
testcase_16 AC 79 ms
12,160 KB
testcase_17 AC 79 ms
12,288 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]
			puts 'Yes'
			exit
		end
	end
end
puts 'No'
0