|
|
вернуться в форумYou can consider that the cost of the tunnel is 1, and the bridge is 24000. Then it becomes a MST problem. would be better to make weight tunnel 0, the weight of the bridge 1, and the answer is weight of minimal spanning tree Your idea is interesting, but weird a bit. :) It can be solved with DFS easily. Moreover, you even don't need to know anything about bridges. |
|
|