結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2022-11-03 17:53:23 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 82 ms / 5,000 ms |
コード長 | 247 bytes |
コンパイル時間 | 35 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-07-18 02:09:04 |
合計ジャッジ時間 | 1,387 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
コンパイルメッセージ
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
ソースコード
w, h, c = gets.splitw = w.to_ih = h.to_id = "BW".tr(c, "")e = c + dl1 = w.even? ? e * (w / 2) : e * (w /2) + cl2 = l1[1..] + l1[-1].tr("BW", "WB")a, b = h.divmod(2)a.times do |i|puts l1puts l2endb.times do |j|puts l1end