【BZOJ】【P1109】【POI2007】【堆积木Klo】【题解】【LIS】
来源:互联网 发布:sql存储过程是什么 编辑:程序博客网 时间:2024/05/01 13:17
传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1109
Seter是厉害http://seter.is-programmer.com/posts/32037.html
Code:
#include<bits/stdc++.h>using namespace std;const int maxn=1e5+5;pair<int,int> a[maxn];int d[maxn];int s,n,size;int main(){scanf("%d",&n);for(int i=1;i<=n;i++){scanf("%d",&a[++s].second);if(a[s].second>i)s--;else{a[s].first=i-a[s].second;}}sort(a+1,a+1+s);for(int i=1;i<=s;i++){int j=lower_bound(d,d+size,a[i].second)-d;d[j]=a[i].second;size=max(size,j+1);}cout<<size<<endl;return 0;}
0 0
- 【BZOJ】【P1109】【POI2007】【堆积木Klo】【题解】【LIS】
- BZOJ 1109 POI2007 堆积木Klo LIS
- BZOJ 1109: [POI2007]堆积木Klo LIS
- bzoj 1109: [POI2007]堆积木Klo LIS
- 1109: [POI2007]堆积木Klo DP LIS
- BZOJ 1109 [POI2007]堆积木Klo DP
- BZOJ 1109: [POI2007]堆积木Klo
- BZOJ 1109: [POI2007]堆积木Klo 神分析, LIS, BIT, 二分
- BZOJ1109 [POI2007]堆积木Klo
- 【bzoj1109】 [POI2007]堆积木Klo
- BZOJ1109: [POI2007]堆积木Klo
- [BZOJ1109][POI2007]堆积木 DP+二分
- 【BZOJ】【P1112】【POI2008】【砖块Klo】【题解】【map】
- BZOJ 1107 POI2007 驾驶考试egz LIS
- 【BZOJ】【POI2007】【对称轴osi】【题解】【计算几何】
- 【BZOJ】【P1101】【POI2007】【Zap】【题解】【莫比乌斯反演】
- 【BZOJ】【P1098】【POI2007】【办公楼biu】【题解】【链表+BFS】
- 【BZOJ】【P1106】【POI2007】【立方体大作战tet】【题解】【树状数组】
- 无线路由的桥接
- selenium webdriver学习(十五)------------如何处理FirefoxProfile
- PAT 3-04 一元多项式的乘法与加法运算(C语言实现)
- mac系统常用操作
- 搭建Windows下的Android开发环境
- 【BZOJ】【P1109】【POI2007】【堆积木Klo】【题解】【LIS】
- Leetcode: Minimum Depth of Binary Tree
- 交换机基础
- 架构师修炼 后记 - 推荐必读的巨著
- [IOS]新浪微博项目1.0
- jQ中遇到的小问题-----Jquery调用出现ReferenceError: $ is not defined
- 网络协议 知识汇总(整理中)
- 数据结构实验一(类模板与多文件结构) 终于补上...
- DFA+dp+zoj2337