Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
193006 | zjx1015 | 最长连续上升子序列 | C++ | 解答错误 | 0 | 0 MS | 256 KB | 383 | 2025-05-04 20:40:15 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; scanf("%d",&n); vector<int> v; int temp; for(int i=0;i<n;i++){ scanf("%d",&temp); v.push_back(temp); } vector<int> dp; for(auto num:v){ auto pos=lower_bound(dp.begin(),dp.end(),num); if(pos==dp.end())dp.push_back(num); else *pos=num; } printf("%d",dp.size()); }