/ WOJ /

记录详情

Accepted


  
# 状态 耗时 内存占用
#1 Accepted 1ms 364.0 KiB
#2 Accepted 1ms 380.0 KiB
#3 Accepted 42ms 816.0 KiB
#4 Accepted 42ms 824.0 KiB
#5 Accepted 43ms 812.0 KiB
#6 Accepted 4ms 472.0 KiB
#7 Accepted 42ms 812.0 KiB
#8 Accepted 4ms 364.0 KiB
#9 Accepted 4ms 432.0 KiB
#10 Accepted 4ms 460.0 KiB

代码

#include<bits/stdc++.h>
using namespace std;

int homo,ztx[100001]={1},dp[100001];

int main(){
	cin>>homo;
	for(int i=1;i<=homo;++i){
		cin>>ztx[i];
	}
	dp[1]=ztx[1];
	for(int i=2;i<=homo;++i){
		if(dp[ztx[0]]<ztx[i]){
			dp[++ztx[0]]=ztx[i];
		}
		else{
			dp[0]=1;
			while(ztx[i]>dp[dp[0]]){
				++dp[0];
			}
			dp[dp[0]]=ztx[i];
		}
	}
	cout<<ztx[0]<<endl;
	return 0;
}

信息

递交者
类型
递交
题目
P1003 [LIS模板]114514个ztx(doge)
题目数据
下载
语言
C++
递交时间
2024-05-02 10:54:26
评测时间
2024-05-02 10:54:26
评测机
分数
100
总耗时
193ms
峰值内存
824.0 KiB