Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
193010 zjx1015 导弹拦截 C++ 通过 100 2 MS 296 KB 559 2025-05-04 21:26:29

Tests(10/10):


#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 ",dp.size()); vector<int> dpp; for(auto num:v){ auto pos=upper_bound(dpp.begin(),dpp.end(),num); if(pos==dpp.begin())dpp.insert(dpp.begin(),num); else *(pos-1)=num; } printf("%d",dpp.size()); return 0; }


测评信息: