結果

問題 No.82 市松模様
ユーザー YatsukuYatsuku
提出日時 2015-12-01 13:15:12
言語 Ruby
(3.3.0)
結果
AC  
実行時間 81 ms / 5,000 ms
コード長 313 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 11,288 KB
実行使用メモリ 15,264 KB
最終ジャッジ日時 2023-10-12 05:51:17
合計ジャッジ時間 2,243 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,196 KB
testcase_01 AC 78 ms
15,132 KB
testcase_02 AC 78 ms
15,136 KB
testcase_03 AC 77 ms
15,116 KB
testcase_04 AC 78 ms
15,192 KB
testcase_05 AC 79 ms
15,264 KB
testcase_06 AC 78 ms
15,000 KB
testcase_07 AC 79 ms
15,004 KB
testcase_08 AC 81 ms
15,120 KB
testcase_09 AC 79 ms
15,112 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 ""
	if inputs[0].to_i % 2 == 0
		k += 1
	end
end
0