
最长上升子序列
zafkiel_nightmare
弱弱的程序员
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 1087 Super Jumping! Jumping! Jumping!
给出一个序列,求所有上升序列中和最大的一个值m,(该序列不一定连续)例如4 1 3 2 4这组数据的结果为8#include#include#define maxn 1000+5using namespace std;int rem[maxn],dp[maxn];int main(){ int n; while(cin>>n&&n) { for(int i=0;i>r原创 2015-04-25 19:54:31 · 586 阅读 · 0 评论 -
hdu 1422 重温世界杯
很简单,没什么好说的,和最长上升序列一个类型#include#define maxn 200000+5using namespace std;int n,x,y;int mapp[maxn];int main(){ cin.sync_with_stdio(false); mapp[0]=0; while(cin>>n) { for(int i=1;i<=n;i++)原创 2015-05-04 20:56:09 · 608 阅读 · 0 评论 -
hdu 5256 序列变换
最长上升子序列 nlogn;也是从别人的博客学来的#include#include#define maxn 100000+5using namespace std;int n;int a[maxn];int solve(int b[],int l){ int f[maxn];//f[i]表示子序列长度为i+1的序列中,末尾元素最小的元素的值 int k=0; f[k++]原创 2015-06-05 20:36:48 · 708 阅读 · 0 评论 -
hdu 1025 Constructing Roads In JGShining's Kingdom
http://blog.csdn.net/sdjzping/article/details/8762508最长上升子序列#include#include#define maxn 500010using namespace std;int n,casee=1;struct stu{ int x,y;};stu mapp[maxn];bool cmp(stu x,stu y原创 2016-03-31 21:47:42 · 268 阅读 · 0 评论