题目链接

最长上升子序列O(n*log(n))的做法,只能用于求长度不能求序列。

#include <iostream>
#include <algorithm>
using namespace std;
const int N=;
int s[N],x;
int main()
{
int n;
while(cin>>n){
int top=;
for(int i=;i<n;i++){
cin>>x;
if(top==||s[top-]<x) s[top++]=x;
else s[upper_bound(s,s+top,x)-s]=x;
}
cout<<top<<endl;
}
return ;
}

POJ 2533 Longest Ordered Subsequence LCS O(n*log(n))的更多相关文章

  1. POJ 2533 Longest Ordered Subsequence LIS O(n*log(n))

    题目链接 最长上升子序列O(n*log(n))的做法,只能用于求长度不能求序列. #include <iostream> #include <algorithm> using ...

  2. poj 2533 Longest Ordered Subsequence 最长递增子序列

    作者:jostree 转载请注明出处 http://www.cnblogs.com/jostree/p/4098562.html 题目链接:poj 2533 Longest Ordered Subse ...

  3. POJ 2533 Longest Ordered Subsequence(裸LIS)

    传送门: http://poj.org/problem?id=2533 Longest Ordered Subsequence Time Limit: 2000MS   Memory Limit: 6 ...

  4. POJ 2533 Longest Ordered Subsequence(LIS模版题)

    Longest Ordered Subsequence Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 47465   Acc ...

  5. POJ 2533 - Longest Ordered Subsequence - [最长递增子序列长度][LIS问题]

    题目链接:http://poj.org/problem?id=2533 Time Limit: 2000MS Memory Limit: 65536K Description A numeric se ...

  6. Poj 2533 Longest Ordered Subsequence(LIS)

    一.Description A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequenc ...

  7. POJ 2533 Longest Ordered Subsequence(最长上升子序列(NlogN)

    传送门 Description A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subseque ...

  8. POJ 2533 Longest Ordered Subsequence 最长递增序列

      Description A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequenc ...

  9. poj 2533 Longest Ordered Subsequence(LIS)

    Description A numeric sequence of ai is ordered ifa1 <a2 < ... < aN. Let the subsequence of ...

随机推荐

  1. maven和svn区别

    构建工具-maven,版本控制工具-svn. 一.只有svn的情况        首先考虑没有maven的情况.这样的话,项目组每个开发人员,都需要在本地check out所有的源码. 每次提交之前, ...

  2. Entity Framework 6连接Postgresql、SQLite、LocalDB的注意事项和配置文件

    Postgresql Postgresql支持Code First的方式自动生成表,不过默认的模式是dbo而不是public,而且还可以自动生成自增主键. <?xml version=" ...

  3. 【转】Tomcat启用HTTPS协议配置过程

    转载请注明出处: http://blog.csdn.net/gane_cheng/article/details/53001846 http://www.ganecheng.tech/blog/530 ...

  4. ERwin入门

    1.菜单介绍 2.选择建模语言符号

  5. HiShop2.x版本中的上传插件分析,得出所用的模板语言为Underscore.js 1.6.0且自己已修改

    效果: 上传组件非常的酷,但是分析其使用JS写法使用了模板语言的,代码如下: <script type="text/j-template" id="tpl_popb ...

  6. UEFI模式安装Win10和Linux双系统

    最近心血来潮,想装一个Linux.Windows双系统,吸取上次安装的经验,这次一定都要使用UEFI模式启动,需要注意的是必须是支持此种启动模式的系统(一般解压之后都有efi文件夹不需要刻录),这次遇 ...

  7. css之IE透明度

    原文链接:http://caibaojian.com/rgba-filter.html .bg{ /*Filter for IE8 */ -ms-filter: "progid:DXImag ...

  8. 2016福州大学软件工程 团队Git Review

    606Connected组: git地址:https://github.com/606notconnected/Beta.git 文件忽略:使用gitignore较正确 版本控制:只有1次commit ...

  9. Matlab插值函数

    x=0:2*pi; y=sin(x); xx=0:0.5:2*pi; %interp1对sin函数进行分段线性插值,调用interp1的时候,默认的是分段线性插值 y1=interp1(x,y,xx) ...

  10. <<编程之美>>1.2读后有感

    问题提出 中国象棋的"将","帅"问题,他俩不能在一条直线上.求出他们的合法位置,并且只能用一个变量. 分析 一头雾水,不明所以.往下看了下,感觉像是程序员为难 ...