結果

問題 No.659 徘徊迷路
ユーザー letrangerjpletrangerjp
提出日時 2018-03-03 20:15:59
言語 Ruby
(3.2.2)
結果
AC  
実行時間 604 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 11,320 KB
実行使用メモリ 15,512 KB
最終ジャッジ日時 2023-09-17 15:43:12
合計ジャッジ時間 6,564 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,252 KB
testcase_01 AC 95 ms
15,388 KB
testcase_02 AC 134 ms
15,472 KB
testcase_03 AC 115 ms
15,236 KB
testcase_04 AC 324 ms
15,444 KB
testcase_05 AC 84 ms
15,292 KB
testcase_06 AC 84 ms
15,164 KB
testcase_07 AC 83 ms
15,040 KB
testcase_08 AC 153 ms
15,432 KB
testcase_09 AC 429 ms
15,328 KB
testcase_10 AC 499 ms
15,264 KB
testcase_11 AC 593 ms
15,464 KB
testcase_12 AC 84 ms
15,332 KB
testcase_13 AC 600 ms
15,392 KB
testcase_14 AC 600 ms
15,268 KB
testcase_15 AC 602 ms
15,368 KB
testcase_16 AC 604 ms
15,512 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

R,C,T,Y,X,H,W=gets(?#).split.map &:to_i
B=*$<
s=(N=0...R).map{|y|(M=0...C).map{|x|[1,0,-1,0,1].each_cons(2).select{|h,w|(B[y+h]||[])[x+w]!=?#}}}
d=N.map{[0]*C}
d[Y][X]=1.0
[T,5000+T%2].min.times{n=N.map{[0]*C}
N.map{|y|M.map{|x|B[y][x]!=?.||(t=s[y][x];t[0]?t.map{|h,w|n[y+h][x+w]+=d[y][x]/t.size}:n[y][x]+=d[y][x])}}
d=n}
p d[H][W]
0