結果

問題 No.82 市松模様
ユーザー rkyrky
提出日時 2017-11-07 17:25:02
言語 Ruby
(3.3.0)
結果
AC  
実行時間 73 ms / 5,000 ms
コード長 223 bytes
コンパイル時間 56 ms
コンパイル使用メモリ 11,368 KB
実行使用メモリ 15,328 KB
最終ジャッジ日時 2023-08-15 20:14:37
合計ジャッジ時間 1,459 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
15,156 KB
testcase_01 AC 71 ms
15,328 KB
testcase_02 AC 71 ms
15,132 KB
testcase_03 AC 72 ms
15,088 KB
testcase_04 AC 72 ms
15,092 KB
testcase_05 AC 72 ms
15,304 KB
testcase_06 AC 70 ms
15,292 KB
testcase_07 AC 72 ms
15,112 KB
testcase_08 AC 73 ms
15,228 KB
testcase_09 AC 72 ms
15,044 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - list
Syntax OK

ソースコード

diff #

width, height, color = gets.chomp.split(" ")
list = Array.new

height.to_i.times do 
	width.to_i.times do
		print color
		color = color == "B" ? "W" : "B"
	end
	color = color == "B" ? "W" : "B" if width.to_i.even?
	puts
end
0