为什么有人把自己的脑残pa帖子转到joke?# Joke - 肚皮舞运动
s*e
1 楼
Given a matrix, each element is either s(start), a(availbe), b(block).
There are many s in the matrix,
compute the shortest path of each a(availbe) element.
distance from s or a to ajacent element is 1。
from s or a to b(block) is +ulimited.
compute the shortest distance from a(available) element to all s (start)
node
for exmaple.
s a a a s
the result would be
0 1 2 1 0
for
s b s b s
a b a b a
a b a b a
a a a a a
the result would be
0 + 0 + 0
1 + 1 + 1
2 + 2 + 2
3 4 3 4 3
There are many s in the matrix,
compute the shortest path of each a(availbe) element.
distance from s or a to ajacent element is 1。
from s or a to b(block) is +ulimited.
compute the shortest distance from a(available) element to all s (start)
node
for exmaple.
s a a a s
the result would be
0 1 2 1 0
for
s b s b s
a b a b a
a b a b a
a a a a a
the result would be
0 + 0 + 0
1 + 1 + 1
2 + 2 + 2
3 4 3 4 3