这道题的正解是 Floyd 最短路加 状态压缩DP,但是我们用朴素解法 DFS 枚举游览顺序也能在考试时拿到一定的分数。
题意:从城市 0 出发,逛完全部 n 个城市后回到 0,城市之间费用由邻接矩阵给出,允许重复经过城市,求最低总费用。
朴素思路:
小明是一名旅游爱好者,他热爱到处游玩,这个寒假也不例外。
By signing up a CodeFun2000 universal account, you can submit code and join discussions in all online judging services provided by us.