当前位置:网站首页>(greedy + longest ascending subsequence) acwing 896 Longest ascending subsequence II
(greedy + longest ascending subsequence) acwing 896 Longest ascending subsequence II
2022-06-11 23:35:00 【Age worry】
896. Longest ascending subsequence II
Topic link https://www.acwing.com/problem/content/898/
subject :
Ideas : Find less than in the queue t The subscript of the largest number of .a[0] Initialize minimum , Make sure that the number you enter must be in... At the time of two minutes a[0] To the right of
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int a[100010],k;
int erfen(int u){
int l=0,r=k;
while(l<r){
int mid=l+r+1>>1;
if(a[mid]<u) l=mid;
else r=mid-1;
}
return l;
}
int main(){
int n;
cin>>n;
a[0]=-1e9-10;
for(int i=0;i<n;i++){
int t;
scanf("%d",&t);
int index=erfen(t);
a[++index]=t;
k=max(k,index);
}
cout<<k;
return 0;
}
边栏推荐
- Here we go! Dragon lizard community enters PKU classroom
- Vs code writing assembly code [microcomputer principle]
- 队列(C语言)
- Unity3d C#开发微信小游戏音频/音效播放问题解决过程分享
- sonarqube介绍和安装步骤
- 2022 safety officer-b certificate theoretical question bank and simulation test
- require. context
- Single page pull-down refresh and double page pull-down refresh of MUI
- [day15 literature extensive reading] numerical magnetic effects temporary memories but not time encoding
- Application of Lora wireless communication module Lora technology in smart home light control
猜你喜欢

RF中使用reuqests的两种方式

Jenkins基本配置

CD流程

Unity3d C # development of wechat games audio / sound playback problem solving process sharing
![[day13-14 intensive literature reading] cross dimensional magnetic interactions arise from memory interference](/img/e0/94602f0b7b6e50f55e29b6147a9df2.png)
[day13-14 intensive literature reading] cross dimensional magnetic interactions arise from memory interference

How to make scripts executable anywhere

Beginner JS BOM implementation window centered

HMS core shows the latest open capabilities in mwc2022, helping developers build high-quality applications
![[day4 literature intensive reading] space – time interdependence: evidence against Asymmetric mapping between time and space](/img/ce/f3817690a024cfebcf58a5ccc3cfdc.png)
[day4 literature intensive reading] space – time interdependence: evidence against Asymmetric mapping between time and space

The latest "capsule Network Overview" paper of imperial technology, etc., 29 pages of PDF, expounds the concept, method and application of capsule
随机推荐
2022年安全员-A证考题模拟考试平台操作
免费分享1个新媒体运营必备的宝藏网站
Custom font settings
mysql——find_ in_ Set usage
Wake up wrist - neural network and deep learning (tensorflow application) updating
Jenkins basic configuration
[Delphi] determine the encoding method of the file (ANSI, Unicode, utf8, unicodebig)
Jenkins of the integrate tool
oracle中dblink操作
Introduction and installation steps of sonarqube
帝国理工等最新《胶囊网络综述》论文,29页pdf阐述胶囊的概念、方法与应用
What are the pitfalls of redis's current network: using a cache and paying for disk failures?
【Day4 文献精读】Space–time interdependence: Evidence against asymmetric mapping between time and space
CVPR 2022 | 元学习在图像回归任务的表现
思科私有动态路由协议:EIGRP
Share a treasure website necessary for new media operation for free
Solr之基礎講解入門
El select drop-down box style combined with El table (pseudo) combined with drop-down selection
Jetpack架构组件学习(3)——Activity Results API使用
A method of relay for ultra long distance wireless transmission of low power wireless module