当前位置:网站首页>Bubble Sort Graph
Bubble Sort Graph
2022-07-02 00:56:00 【Learning KL & TK】
The title means that you can find the longest ascending subsequence
#include"bits/stdc++.h"
#define ll long long
#define pi pair<int,int>
#define inf 0x3f3f3f3f
#define _for(i,a,b) for(int i=a;i<=b;i++)
#define for_(i,a,b) for(int i=a;i<b;i++)
#define _fr(i,a,b) for(int i=a;i>=b;i--)
#define fr_(i,a,b) for(int i=a;i>b;i--)
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;
const int N = 1e5+5;
const ll mod = 1e9+7;
const double lp=1.000000011;
map<char,int>mp;
int n,x;
int a[N],b[N],c[N];
void solve(){
cin >> n;
_for(i,1,n) cin >> a[i];
_for(i,1,n) b[i]=inf;
_for(i,1,n){
int k = lower_bound(b+1,b+1+n,a[i])-b;
c[i]=k;
b[k]=a[i];
}
int ans = -inf;
_for(i,1,n){
ans = max(ans,c[i]);
}
cout << ans << endl;
}
int main()
{
IOS;
solve();
return 0;
}边栏推荐
- Talents come from afar, and Wangcheng district has consolidated the intellectual base of "strengthening the provincial capital"
- RFID makes the inventory of fixed assets faster and more accurate
- 【八大排序④】归并排序、不基于比较的排序(计数排序、基数排序、桶排序)
- Global and Chinese markets for maritime services 2022-2028: Research Report on technology, participants, trends, market size and share
- Weather forecast applet source code weather wechat applet source code
- Intelligent operation and maintenance practice: banking business process and single transaction tracking
- excel数据透视表
- Mitsubishi PLC FX3U pulse axis jog function block (mc_jog)
- [opencv450] hog+svm and hog+cascade for pedestrian detection
- 449 original code, complement code, inverse code
猜你喜欢

Friends circle community program source code sharing

【八大排序①】插入排序(直接插入排序、希尔排序)
![[conference resources] the Third International Conference on Automation Science and Engineering in 2022 (jcase 2022)](/img/a6/a2afdf9e18255c9171f61bf074998b.png)
[conference resources] the Third International Conference on Automation Science and Engineering in 2022 (jcase 2022)

XMIND mind map

Xinniuniu blind box wechat applet source code_ Support flow realization, with complete material pictures

【会议资源】2022年第三届自动化科学与工程国际会议(JCASE 2022)

AIX存储管理之卷组的创建(一)

gradle

Promise and modular programming

gradle
随机推荐
Otaku wallpaper Daquan wechat applet source code - with dynamic wallpaper to support a variety of traffic owners
Zak's latest "neural information transmission", with slides and videos
Promise和模块块化编程
Viewing and modifying volume group attributes of Aix storage management (II)
Random avatar encyclopedia, multi category wechat applet source code with history_ Support traffic master
Iclr2022 | spherenet and g-spherenet: autoregressive flow model for 3D molecular graph representation and molecular geometry generation
LeetCode 0241.为运算表达式设计优先级 - DFS
XMIND mind map
2022拼多多详情/拼多多商品详情/拼多多sku详情
Weather forecast applet source code weather wechat applet source code
[conference resources] the Third International Conference on Automation Science and Engineering in 2022 (jcase 2022)
[wechat authorized login] the small program developed by uniapp realizes the function of obtaining wechat authorized login
LeetCode 0241. Design priority for arithmetic expressions - DFS
Global and Chinese markets for distributed generation and energy storage in telecommunications networks 2022-2028: Research Report on technology, participants, trends, market size and share
cookie、session、tooken
How to type spaces in latex
BiLSTM-CRF代码实现
What is ThreadLocal memory leak and how to solve it
Slf4j print abnormal stack information
Global and Chinese market of wireless charging magnetic discs 2022-2028: Research Report on technology, participants, trends, market size and share