結果

問題 No.157 2つの空洞
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-02-27 02:10:45
言語 Ruby
(3.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 332 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 11,564 KB
実行使用メモリ 15,536 KB
最終ジャッジ日時 2023-09-06 03:23:42
合計ジャッジ時間 15,862 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,160 KB
testcase_01 AC 90 ms
15,356 KB
testcase_02 AC 99 ms
15,264 KB
testcase_03 AC 119 ms
15,372 KB
testcase_04 AC 140 ms
15,460 KB
testcase_05 AC 173 ms
15,272 KB
testcase_06 AC 303 ms
15,352 KB
testcase_07 AC 111 ms
15,272 KB
testcase_08 AC 104 ms
15,420 KB
testcase_09 AC 173 ms
15,160 KB
testcase_10 AC 116 ms
15,456 KB
testcase_11 AC 375 ms
15,260 KB
testcase_12 AC 742 ms
15,376 KB
testcase_13 AC 1,096 ms
15,156 KB
testcase_14 AC 1,340 ms
15,156 KB
testcase_15 AC 1,643 ms
15,204 KB
testcase_16 AC 1,996 ms
15,372 KB
testcase_17 TLE -
testcase_18 AC 1,985 ms
15,536 KB
testcase_19 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m=gets.split.map &:to_i
a=(1..m).map{gets}
c=99
(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