摘要: 题目大意: http://codevs.cn/problem/1048/ 基本思路: dp[i][j]代表把i到j堆的堆在一起所需要的最小花费。dp[i][j] = min(dp[i][j],dp[i][k]+dp[k+1][j]+wi+....+wj)。 代码: #include <iostrea 阅读全文
posted @ 2017-09-06 22:11 prog123 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 题目大意: http://codevs.cn/problem/1214/ 代码: #include <iostream> #include <algorithm> #include <cstring> using namespace std; struct type{ int x,y; }; int 阅读全文
posted @ 2017-09-06 22:05 prog123 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题目大意: http://codevs.cn/problem/1044/ 第一问题就是求序列的最长递减数列的长度,第二问就是求数列的最长递增序列的长度。 代码: #include <iostream> using namespace std; int arr[30] = {0}; int dp[30 阅读全文
posted @ 2017-09-06 16:46 prog123 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 题目大意: http://codevs.cn/problem/3027/ 源码: #include <iostream> using namespace std; struct { int x,y,val; }tmp[1050]; int dp[1050] = {0}; int main() { i 阅读全文
posted @ 2017-09-06 14:56 prog123 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 题目大意: http://codevs.cn/problem/1576/ 代码: 阅读全文
posted @ 2017-09-06 14:17 prog123 阅读(143) 评论(0) 推荐(0) 编辑