結果

問題 No.82 市松模様
ユーザー Yatsuku
提出日時 2015-12-01 13:10:02
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-09-14 06:58:34
合計ジャッジ時間 1,575 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 5 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:11: warning: assigned but unused variable - i
Main.rb:12: warning: assigned but unused variable - j
Syntax OK

ソースコード

diff #

inputs = gets.split.map(&:to_s)
k = 0
if inputs[2] == "B"
	color1 = "B"
	color2 = "W"
else
	color1 = "W"
	color2 = "B"
end

for i in 1..inputs[1].to_i
	for j in 1..inputs[0].to_i
		k += 1
		if k.odd? == true
			print color1
		else
			print color2
		end
	end
	puts ""
end
0