結果
問題 | No.82 市松模様 |
ユーザー |
|
提出日時 | 2015-12-01 13:15:12 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 88 ms / 5,000 ms |
コード長 | 313 bytes |
コンパイル時間 | 342 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-09-14 05:16:13 |
合計ジャッジ時間 | 1,718 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
コンパイルメッセージ
Main.rb:11: warning: assigned but unused variable - i Main.rb:12: warning: assigned but unused variable - j Syntax OK
ソースコード
inputs = gets.split.map(&:to_s)k = 0if inputs[2] == "B"color1 = "B"color2 = "W"elsecolor1 = "W"color2 = "B"endfor i in 1..inputs[1].to_ifor j in 1..inputs[0].to_ik += 1if k.odd? == trueprint color1elseprint color2endendputs ""if inputs[0].to_i % 2 == 0k += 1endend