結果

問題 No.157 2つの空洞
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-02-27 02:11:20
言語 Ruby
(3.3.0)
結果
AC  
実行時間 948 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 11,600 KB
実行使用メモリ 15,412 KB
最終ジャッジ日時 2023-09-06 03:26:03
合計ジャッジ時間 8,655 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
15,340 KB
testcase_01 AC 86 ms
15,280 KB
testcase_02 AC 93 ms
15,292 KB
testcase_03 AC 101 ms
15,188 KB
testcase_04 AC 112 ms
15,232 KB
testcase_05 AC 129 ms
15,408 KB
testcase_06 AC 186 ms
15,280 KB
testcase_07 AC 97 ms
15,412 KB
testcase_08 AC 94 ms
15,264 KB
testcase_09 AC 126 ms
15,368 KB
testcase_10 AC 104 ms
15,136 KB
testcase_11 AC 215 ms
15,228 KB
testcase_12 AC 379 ms
15,412 KB
testcase_13 AC 524 ms
15,276 KB
testcase_14 AC 628 ms
15,192 KB
testcase_15 AC 787 ms
15,356 KB
testcase_16 AC 943 ms
15,356 KB
testcase_17 AC 948 ms
15,232 KB
testcase_18 AC 914 ms
15,364 KB
testcase_19 AC 908 ms
15,264 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m=gets.split.map &:to_i
a=(1..m).map{gets}
c=40
(0...m).any?{|x|(0...n).any?{|y|a[x][y]>?-&&(a[x][y]=?!
c.times{m.times{|x|n.times{|y|m.times{|z|n.times{|w|(x-z).abs+(y-w).abs<2&&a[x][y]<?"&&a[z][w]>?-&&(a[z][w]=?!)}}}}})}}
m.times{|x|n.times{|y|m.times{|z|n.times{|w|a[x][y]+a[z][w]==".!"&&c=[c,(x-z).abs+(y-w).abs-1].min}}}}
p c
0