結果

問題 No.179 塗り分け
ユーザー gigurururu
提出日時 2015-04-06 00:44:12
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 298 bytes
コンパイル時間 47 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 13,184 KB
最終ジャッジ日時 2024-10-02 13:36:59
合計ジャッジ時間 59,720 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 33 WA * 6 TLE * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

H,W=gets.split.map(&:to_i)
m=(1..H).map{gets.chomp}+[""]*50

ans=false
H.times{|i|W.times{|j|
  next if i==0&&j==0

  tm=m.map{|l|l.dup}
  H.times{|h|W.times{|w|
    if tm[h][w]==?# && tm[h+i][w+j]==?#
      tm[h][w]=tm[h+i][w+j]=?.
    end
  }}

  ans = true if !(tm*"")[?#]
}}
puts ans ?:YES:"NO"
0