Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
193005 zjx1015 最长连续上升子序列 C++ 解答错误 0 0 MS 252 KB 383 2025-05-04 20:39:17

Tests(0/20):


#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=upper_bound(dp.begin(),dp.end(),num); if(pos==dp.end())dp.push_back(num); else *pos=num; } printf("%d",dp.size()); }


测评信息: