由于这道题的输出太过庞大而且之前提供的oj也没有spj,无法验证代码正确性,所以这道题仅提供思路,就不附代码了,这道题其实和之前几道网格题是挺像的,只不过这道题有的地方有石头,有的地方没有石头,有的地方还不能走,那么我们就像之前的那样建图,把一个点拆分成两个点,每两个点之间连一条INF,费用为0的边,如果一个点有石头就多开出一条容量为1,费用为1的边,这样跑出最大费用最大流再在残量网络中找一找路径就可以了。
【网络流24题】火星探险问题
最新推荐文章于 2020-10-14 16:04:56 发布