Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
193008 | zjx1015 | 导弹拦截 | C++ | 解答错误 | 0 | 0 MS | 240 KB | 535 | 2025-05-04 21:17:55 |
#include<bits/stdc++.h> using namespace std; int main(){ int temp; vector<int> v; while(scanf("%d",&temp)!=EOF) v.insert(v.begin(),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\n",dp.size()); dp.clear(); 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()); return 0; }