結果
問題 |
No.82 市松模様
|
ユーザー |
![]() |
提出日時 | 2016-06-05 15:35:05 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 390 bytes |
コンパイル時間 | 305 ms |
コンパイル使用メモリ | 7,168 KB |
実行使用メモリ | 13,824 KB |
最終ジャッジ日時 | 2024-10-08 15:45:01 |
合計ジャッジ時間 | 1,971 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 1 WA * 6 |
コンパイルメッセージ
Main.rb:11: warning: mismatched indentations at 'else' with 'if' at 8 Main.rb:13: warning: mismatched indentations at 'end' with 'else' at 11 Syntax OK
ソースコード
w, h, c = gets.strip.split(' ') w = w.to_i h = h.to_i result = '' w.times {|i| h.times {|j| result += if i % 2 == 0 then if j % 2 == 0 then '0' else '1' end else if j % 2 == 1 then '0' else '1' end end } result += "\n" } if c === 'W' then result.gsub!('0', 'W').gsub!('1', 'B') else result.gsub!('0', 'B').gsub!('1', 'W') end puts result