题意:给定一个邻接矩阵得到有向图,判断是否存在哈密顿回路,若存在,输出路径,否则输出-1;思路:将每个点作为head遍历一次求哈密顿通路,看是否存在哈密顿回路;一个点的时候需要特判;#include#include#includeusing namespace std;int n,m;int mm[... Read More
posted @ 2015-09-02 20:51 dominating Views(441) Comments(0) Diggs(0)