摘要: https://vjudge.net/contest/68966#problem/F 初始化就行了;dp【0】=0; 这题还要刚好装满背包,输出时进行判断 阅读全文
posted @ 2017-03-12 20:32 walfy 阅读(135) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/68966#problem/E dp【i】=a【i】这一步一定不能忘了!! 阅读全文
posted @ 2017-03-12 20:04 walfy 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include #include #include #include #define ll long long using namespace std; const int N=100; int dp[N][N]; int main() { char s1[... 阅读全文
posted @ 2017-03-12 18:46 walfy 阅读(421) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/150953#problem/D 此题关键 就是排序,刚开始按q排序结果想死都想不出来应该是q-p排 一维的dp 二维的dp 阅读全文
posted @ 2017-03-12 13:40 walfy 阅读(463) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/150953#problem/B 转化一下就行了,<5时要特判 阅读全文
posted @ 2017-03-12 12:25 walfy 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 今天复习背包,之前集训讲过,现在又忘了,昨天杭电校赛刚好有一题背包,居然不会做了,好尴尬,重新复习一下。 https://vjudge.net/contest/150953#problem/A 可以说是最基础的01背包了 最重要的就是状态转移方程了dp[j]=max(dp[j],dp[j-w[i]] 阅读全文
posted @ 2017-03-12 12:07 walfy 阅读(175) 评论(0) 推荐(0) 编辑