1 条题解
-
0
动态数组计算最长不升子序列及严格上升子序列,支持1000枚导弹和重复高度。
#include <bits/stdc++.h> using namespace std; int main(){ios::sync_with_stdio(false);cin.tie(nullptr); vector<int>tops;int x;while(cin>>x){auto it=lower_bound(tops.begin(),tops.end(),x);if(it==tops.end())tops.push_back(x);else *it=x;}cout<<tops.size()<<"\n"; return 0; }
- 1
信息
- ID
- 3997
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 5
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者