結果

問題 No.82 市松模様
ユーザー Tsuneo YoshiokaTsuneo Yoshioka
提出日時 2014-12-02 23:46:42
言語 Ruby
(3.2.2)
結果
AC  
実行時間 84 ms / 5,000 ms
コード長 221 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 11,504 KB
実行使用メモリ 15,292 KB
最終ジャッジ日時 2023-09-02 01:12:00
合計ジャッジ時間 1,733 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,160 KB
testcase_01 AC 79 ms
15,292 KB
testcase_02 AC 80 ms
15,136 KB
testcase_03 AC 81 ms
15,132 KB
testcase_04 AC 84 ms
15,152 KB
testcase_05 AC 81 ms
15,148 KB
testcase_06 AC 80 ms
15,240 KB
testcase_07 AC 81 ms
15,096 KB
testcase_08 AC 83 ms
15,148 KB
testcase_09 AC 83 ms
15,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

W_, H_, C = gets.split
W = W_.to_i
H = H_.to_i
(0...H).each{|h|
    (0...W).each{|w|
        if (h+w)%2 == (C=="B" ? 0 : 1)
            print "B"
        else
            print "W"
        end
    }
    puts
}
0