随笔分类 -  动态规划---LIS

摘要:題目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087 思路:动态规划 求n个点的和最大上升子序列 d[i]=max(d[j]+a[i]),(j<i且a[j]<a[i]) 阅读全文
posted @ 2018-05-19 22:02 wydxry 阅读(188) 评论(0) 推荐(0) 编辑
摘要:1 O(n^2)的方法: 2 #include <iostream> 3 #include <stdio.h> 4 #include <cstring> 5 #include <algorithm> 6 using namespace std; 7 int a[15010],dp[15010],fr 阅读全文
posted @ 2017-08-07 18:08 wydxry 阅读(596) 评论(0) 推荐(0) 编辑
摘要:We are all familiar with sorting algorithms: quick sort, merge sort, heap sort, insertion sort, selection sort, bubble sort, etc. But sometimes it is 阅读全文
posted @ 2017-07-26 09:37 wydxry 阅读(240) 评论(0) 推荐(0) 编辑
摘要:A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence ( a1, a2, ..., aN) be any sequence ( ai1, 阅读全文
posted @ 2017-07-26 09:34 wydxry 阅读(182) 评论(0) 推荐(0) 编辑
摘要:给出长度为N的数组,找出这个数组的最长递增子序列。(递增子序列是指,子序列的元素是递增的) 例如:5 1 6 8 2 4 5 10,最长递增子序列是1 2 4 5 10。 给出长度为N的数组,找出这个数组的最长递增子序列。(递增子序列是指,子序列的元素是递增的) 例如:5 1 6 8 2 4 5 1 阅读全文
posted @ 2017-07-25 19:31 wydxry 阅读(338) 评论(0) 推荐(0) 编辑

Live2D