結果

問題 No.13 囲みたい!
ユーザー syarosyaro
提出日時 2016-01-18 14:29:00
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 745 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 12,012 KB
実行使用メモリ 23,228 KB
最終ジャッジ日時 2023-10-20 00:37:20
合計ジャッジ時間 7,381 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 84 ms
16,116 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

(h,w),*m=$<.map{|l|l.split.map(&:to_i)+[0]}+[[0]*100]
(h*w).times{|i|
  *a=i
  (
    v,*a=a
    m[y=v%h][v/h]==$c&&(m[y][v/h]=-1;((y<1?[]:[-1])+[1,-h,h]).count{|w|a<<w+=v;m[w%h][w/h]<0}>1&&($><<:possible;_))
  )while a[0]if 0<$c=m[i%h][i/h]
  m.map{|n|n.map!{|t|t<0?0:t}}
}
$><<:impossible
#######################################################################################################################################################################################################################################################################################################################################################################################################################################################################
0