andre_joy

导航

2012年8月4日

hdu 3001

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=3001题意:n(最多10)个城市,可以从任意城市出发,每个城市最多走两次,问最短路径。mark:TSP问题,由于最多走两次,所以是三进制状态压缩DP,第一次写,很艰难。 可以转换成任意进制的~代码:#include <stdio.h>#include <string.h>#include <stdlib.h>const int M = 67149;const int inf = 0x3f3f3f3f;int dp[70000][15];int adj[15][15]; 阅读全文

posted @ 2012-08-04 17:46 andre_joy 阅读(514) 评论(0) 推荐(0) 编辑