結果

問題 No.402 最も海から遠い場所
ユーザー miraxial
提出日時 2016-07-23 00:19:32
言語 Ruby
(3.4.1)
結果
TLE  
実行時間 -
コード長 429 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 90,404 KB
最終ジャッジ日時 2024-11-06 14:03:31
合計ジャッジ時間 9,835 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 TLE * 1 -- * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:26: warning: assigned but unused variable - t
Syntax OK

ソースコード

diff #

h,w=gets.split.map &:to_i
a=[]
h.times do
  g=gets.chomp.split("")
  c=0
  w.times do |i|
    if g[i]==?.
      c=0
      g[i]=0
    else
      c+=1
      g[i]=c
    end
  end
  a<< g
end
w.times do |iw|
  c=0
  h.times do |ih|
    g=a[ih][iw]
    if g==0
      c=0
    else
      c+=1
      g=c if g>c
      t=true
      gg=a[ih-1][iw-1]
      g=gg+1 if gg<g
      a[ih][iw]=g
    end
  end
end
p (a.map{|i|i.max}.max/2.0).round
0