[状态压缩DP] PKU 3311 Hie with the Pie
摘要:
和COJ送货到家一样,不过这里不要求每个点只经过一次,因此可以先用floyd预处理出任意两点间的最短距离,然后状态压缩DP。# include <cstdio># include <cstring># define INF 0x3C3C3C3C# define N 10 + 2int n;int w[N][N];int f[1<<N][N];int Min(int x, int y){ return x<y ? x:y;}int dp(int s, int i){ int &ans = f[s][i]; if (ans != -1) retur 阅读全文
posted @ 2012-08-05 22:54 getgoing 阅读(230) 评论(0) 推荐(0)
浙公网安备 33010602011771号