結果

問題 No.82 市松模様
ユーザー yozayoza
提出日時 2016-02-02 22:16:48
言語 Ruby
(3.3.0)
結果
AC  
実行時間 89 ms / 5,000 ms
コード長 216 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 11,956 KB
実行使用メモリ 15,992 KB
最終ジャッジ日時 2023-10-21 18:46:24
合計ジャッジ時間 1,999 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,992 KB
testcase_01 AC 88 ms
15,992 KB
testcase_02 AC 88 ms
15,992 KB
testcase_03 AC 86 ms
15,992 KB
testcase_04 AC 86 ms
15,992 KB
testcase_05 AC 86 ms
15,992 KB
testcase_06 AC 87 ms
15,992 KB
testcase_07 AC 88 ms
15,992 KB
testcase_08 AC 89 ms
15,992 KB
testcase_09 AC 89 ms
15,992 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

w, h, c = gets.chomp.split
w = w.to_i
h = h.to_i
bw = 'BW'

h.times do |y|
  w.times do |x|
    j = 0
    if c == 'B'
      j = (x + y) % 2
    else
      j = (x + y + 1) % 2
    end
    print bw[j]
  end
  puts
end
0