摘要: HDU 2602 Bone Collector(dp之01背包问题)题目描述:典型的01背包问题。 #include #include #include #define N 1010using namespace std; int dp[N][N]; int tem... 阅读全文
posted @ 2018-08-13 12:27 ronnie14165 阅读(71) 评论(0) 推荐(0) 编辑
摘要: HDU 2084 数塔 (dp)题目描述:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?题目限制:数塔高度#define N 110using namespace std;int main(){ int c;... 阅读全文
posted @ 2018-08-13 12:11 ronnie14165 阅读(76) 评论(0) 推荐(0) 编辑
摘要: HDU 1520 Anniversary party(树形dp)树形dp第一题!!!题意很清晰,思路也很明确。很容易找到根节点,即最大的boss,通过根节点向下dp。状态转移方程: int to = vec[x][i]; dfs(to); dp[x][1] += dp... 阅读全文
posted @ 2018-08-13 00:06 ronnie14165 阅读(82) 评论(0) 推荐(0) 编辑