結果

問題 No.82 市松模様
ユーザー apierceapierce
提出日時 2022-11-03 17:49:47
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 227 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 11,356 KB
実行使用メモリ 15,332 KB
最終ジャッジ日時 2023-09-25 02:05:54
合計ジャッジ時間 1,639 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 81 ms
15,132 KB
testcase_02 AC 80 ms
15,164 KB
testcase_03 AC 79 ms
15,172 KB
testcase_04 AC 80 ms
15,252 KB
testcase_05 AC 80 ms
15,284 KB
testcase_06 AC 81 ms
15,044 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 81 ms
15,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:7: warning: `/' after local variable or literal is interpreted as binary operator
Main.rb:7: warning: even though it seems like regexp literal
Syntax OK

ソースコード

diff #

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

d = "BW".tr(c, "")
e = c + d
l1 = w.even? ? e * (w / 2) : e * (w /2) + c
l2 = l1[1..] + d

a, b = h.divmod(2)
a.times do |i|
    puts l1
    puts l2
end
b.times do |j|
    puts l1
end
0