POJ 3903 —— Stock Exchange 最长上升子序列
来源:互联网 发布:淘宝恒源祥羊毛衫价格 编辑:程序博客网 时间:2024/04/30 14:25
原题:http://poj.org/problem?id=3903
题意:求最长上升子序列的个数;
#include<cstdio>#include<algorithm>using namespace std;const int maxn = 1000000+10;int stack[maxn];int n;int main(){while(~scanf("%d", &n)){int top = 0;stack[top] = -1;for(int i = 1;i<=n;i++){int tmp;scanf("%d", &tmp);if(tmp > stack[top])stack[++top] = tmp;else{int pos = lower_bound(stack+1, stack+top+1, tmp) - stack;stack[pos] = tmp;}}printf("%d\n", top);}return 0;}
0 0
- POJ 3903 —— Stock Exchange 最长上升子序列
- Stock Exchange (POJ 3903) —— 最长上升子序列
- POJ 3903 Stock Exchange 最长上升子序列
- poj 3903 Stock Exchange (最长上升子序列)
- 证券交易所 Stock Exchange 最长上升子序列 poj 3903
- POJ 3903 Stock Exchange (LIS:最长上升子序列)
- poj 3903 Stock Exchange 最长上升子序列
- POJ 3903 Stock Exchange 最长上升子序列 模板题
- poj 3903 Stock Exchange(求最长上升子序列长度)
- poj 3903 stock exchange 最长上升子序列(n*log(n))
- POJ 3903 Stock Exchange 最大上升子序列
- POJ3903 Stock Exchange 最长上升子序列DP]
- poj3903--Stock Exchange--nlogn贪心求最长上升子序列
- poj3903 Stock Exchange(最长上升子序列)
- POJ 3903-Stock Exchange/POJ 2533-Longest Ordered Subsequence(LIS-最长递增子序列长度)
- poj 3903-Stock Exchange最大上升子序(dp)
- poj 3903 最长上升子序列
- poj 3903(最长上升子序列 )
- 仿微信的侧滑退出Activity
- 验证码图像识别-python
- 算法训练 学做菜
- 双重检查加锁机制--解决线程安全
- 【数据结构】堆
- POJ 3903 —— Stock Exchange 最长上升子序列
- Android OkHttp之 offline cache
- G代码 机器人的CNC实现
- C++标准库简介、与STL的关系。
- 亲测实验,RTC使用内部低速时钟LSI时,对RTC的配置过程
- 51Nod 1085 背包问题(01背包 )
- ElasticSearch学习_陶文3_时间序列数据库的秘密(3)——加载和分布式计算
- 二维数组名本质
- MongoDB利用正则表达式查询(pymongo实现)