HDU 2425 Hiking Trip(搜索+优先队列)

Hiking in the mountains is seldom an easy task for most people, as it is extremely easy to get lost during the trip. Recently Green has decided to go on a hiking trip. Unfortunately, half way through the trip, he gets extremely tired and so needs to find the path that will bring him to the destination with the least amount of time. Can you help him?You’ve obtained the area Green’s in as an R * C map. Each grid in the map can be one of the four types: tree, sand, path, and stone. All grids not containing stone are passable, and each time, when Green enters a grid of type X (where X can be tree, sand or path), he will spend time T(X). Furthermore, each time Green can only move up, down, left, or right, provided that the adjacent grid in that direction exists.Given Green’s current position and his destination, please determine the best path for him.

,有事者,事竟成;破釜沉舟,百二秦关终归楚;苦心人,

HDU 2425 Hiking Trip(搜索+优先队列)

相关文章:

你感兴趣的文章:

标签云: