結果

問題 No.659 徘徊迷路
ユーザー letrangerjpletrangerjp
提出日時 2018-03-03 20:24:09
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 41 ms
コンパイル使用メモリ 11,252 KB
実行使用メモリ 15,364 KB
最終ジャッジ日時 2023-09-17 16:05:29
合計ジャッジ時間 2,675 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,112 KB
testcase_01 AC 95 ms
15,364 KB
testcase_02 AC 87 ms
15,172 KB
testcase_03 AC 85 ms
15,028 KB
testcase_04 AC 98 ms
15,276 KB
testcase_05 AC 85 ms
15,032 KB
testcase_06 AC 86 ms
14,992 KB
testcase_07 AC 86 ms
15,324 KB
testcase_08 AC 154 ms
15,248 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 87 ms
15,064 KB
testcase_13 AC 112 ms
15,196 KB
testcase_14 AC 111 ms
15,260 KB
testcase_15 AC 112 ms
15,276 KB
testcase_16 AC 112 ms
15,252 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
(8191&T).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