摘要: 刷水题,贴代码。比较裸的树形DP。。dp(i,j)表示以i节点为根节点用j天时间能够获得的最大价值。由于要往返,m除以2就可以了。View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #define maxn 101 5 using namespace std; 6 int n,m,start,e; 7 int dp[maxn][maxn],next[maxn << 1],v[maxn << 1],cost[maxn << 1] 阅读全文
posted @ 2012-12-11 15:11 浙西贫农 阅读(144) 评论(0) 推荐(0) 编辑