結果

問題 No.82 市松模様
ユーザー wonda_t_coffeewonda_t_coffee
提出日時 2020-01-29 10:40:22
言語 Ruby
(3.3.0)
結果
AC  
実行時間 85 ms / 5,000 ms
コード長 193 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 11,512 KB
実行使用メモリ 15,236 KB
最終ジャッジ日時 2023-10-14 05:21:40
合計ジャッジ時間 1,787 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,128 KB
testcase_01 AC 80 ms
15,204 KB
testcase_02 AC 81 ms
15,124 KB
testcase_03 AC 79 ms
15,112 KB
testcase_04 AC 78 ms
15,084 KB
testcase_05 AC 82 ms
15,104 KB
testcase_06 AC 79 ms
15,032 KB
testcase_07 AC 78 ms
15,236 KB
testcase_08 AC 80 ms
15,080 KB
testcase_09 AC 81 ms
15,128 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

w, h, c = gets.chomp.split
w = w.to_i
h = h.to_i

h.times do |i|
  l = ''
  s = i % 2 == 0 ? c : c == 'W' ? 'B' : 'W'
  w.times do |j|
    l << s
    s = s == 'W' ? 'B' : 'W'
  end
  puts l
end
0