动态规划
RRicky_
这个作者很懒,什么都没留下…
展开
-
【HDU 1087】Super Jumping! Jumping! Jumping!(最大上升子序列和,动态规划)
这里是题目Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 40411 Accepted Submission(s): 18655Problem Descriptio原创 2017-08-09 01:02:07 · 418 阅读 · 0 评论 -
【最长公共子序列】(LCS)
按顺序走,如果不相等就向左或那个方向走右走,当然说向哪儿走就都向/*LCSBDCABAABCBDABdp[1][2] = 1dp[1][1] = 0dp[2][1] = 0//子串:连续//子序列:可以不连续 // LCSdp[i][j]//第一个字符串在第i个字符前且第二个串在第j个字符前可构成的最长子序列的长度 dp[i][j] = 0原创 2017-08-09 01:10:21 · 303 阅读 · 0 评论 -
【LIS最长上升子序列】O(n^2)与O(nlogn)算法(HDU1257)
LIS(最长上升子序列) 子序列:不连续元素 如:4 2 3 1 5; 2 3 5就是LIS有两种方法求,时间复杂度分别为O(n^2)与O(n log n),空间复杂度均为O(n)。但是第一种可以同时求出LIS本身,而第二种只能求出LIS的长度。//O(n^2)#include <cstdio>#include <cstring>#include <algorithm>using nam原创 2017-08-09 17:25:34 · 466 阅读 · 0 评论 -
【lower_bound】【upper_bound】二分查找
头文件: #include<algorithm> using namespace std; //一般加上这个lower_bound:查找序列中的第一个出现的值大于等于val的位置(地址) upper_bound:返回的是第一个一个大于val的位置(地址) 它们要求必须提供至少前向迭代器,且容器元素必须有序 函数lower_bound()在first和last中的前闭后开区间进行二分原创 2017-08-09 20:56:57 · 364 阅读 · 0 评论 -
【HDU1950】Bridging signals (最长上升子序列DP(nlogn))
这里是题目 Bridging signals Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2893 Accepted Submission(s): 1828Problem Description ‘Oh no, they’原创 2017-08-10 00:01:02 · 328 阅读 · 0 评论 -
【HDU1257】最少拦截系统(动态规划)
这里是题目最少拦截系统Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 44248 Accepted Submission(s): 17246Problem Description 某国为了防御敌国的导弹袭击,发展出一原创 2017-08-07 15:57:40 · 379 阅读 · 0 评论 -
【HDU1029】B - Ignatius and the Princess IV (动态规划)
这里是题目Ignatius and the Princess IV Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32767 K (Java/Others) Total Submission(s): 33781 Accepted Submission(s): 14627Problem Description “原创 2017-08-07 23:38:12 · 313 阅读 · 0 评论 -
【HDU1069】 Monkey and Banana(动态规划)
这里是题目Monkey and Banana Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15962 Accepted Submission(s): 8471Problem Description A group of re原创 2017-08-09 00:45:40 · 329 阅读 · 0 评论 -
【POJ2533】Longest Ordered Subsequence (动态规划&最长上升子序列)
这里是题目Longest Ordered Subsequence Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 54195 Accepted: 24230 DescriptionA numeric sequence of ai is ordered if a1 < a2 < … < aN. Let原创 2017-08-09 00:52:25 · 259 阅读 · 0 评论 -
【HDU 1159】Common Subsequence (最长公共子序列)
这里是题目Common Subsequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 40645 Accepted Submission(s): 18757Problem Description A subsequen原创 2017-08-09 00:58:33 · 323 阅读 · 0 评论 -
【HDU1176】免费馅饼(动态规划)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1176免费馅饼Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 51552 Accepted Submission(s): 18010Prob原创 2017-08-10 16:39:12 · 360 阅读 · 0 评论