#include iostream#include fstream#include vector#include algorithmusing namespace std;const int INF = 0x3f3f3f3f;int ans = INF;int n; 城市数量vectorvectorint Map; 商旅问题的图vectorint path; 当前路径vectorbool v
该算法的时间复杂度为$O(n!)$,因为在搜索过程中,需要遍历所有可能的路径,而可能的路径数为$n!$。
原文地址: https://www.cveoy.top/t/topic/ffi7 著作权归作者所有。请勿转载和采集!