結果

問題 No.402 最も海から遠い場所
ユーザー miraxialmiraxial
提出日時 2016-07-23 00:19:32
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 429 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 89,216 KB
最終ジャッジ日時 2024-04-24 06:54:03
合計ジャッジ時間 9,532 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
17,792 KB
testcase_01 AC 75 ms
12,160 KB
testcase_02 AC 79 ms
12,288 KB
testcase_03 AC 75 ms
12,160 KB
testcase_04 AC 75 ms
12,160 KB
testcase_05 AC 75 ms
12,288 KB
testcase_06 AC 77 ms
12,160 KB
testcase_07 AC 76 ms
12,288 KB
testcase_08 AC 88 ms
12,416 KB
testcase_09 AC 89 ms
12,160 KB
testcase_10 AC 93 ms
12,160 KB
testcase_11 AC 92 ms
12,416 KB
testcase_12 AC 92 ms
12,160 KB
testcase_13 AC 95 ms
12,416 KB
testcase_14 AC 85 ms
12,672 KB
testcase_15 AC 177 ms
14,720 KB
testcase_16 AC 232 ms
15,616 KB
testcase_17 AC 2,021 ms
47,104 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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