Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
338433 | 胡珂 | 【C6-7】防御导弹 | C++ | 通过 | 100 | 4 MS | 252 KB | 310 | 2025-08-07 11:06:18 |
#include <bits/stdc++.h> using namespace std; int n,x,s=1,a[1010],p; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>x; p=0; for(int j=1;j<=s;j++){ if(a[j]>=x){ p=j; break; } } if(p==0){ s++; a[s]=x; }else{ a[p]=x; } } cout<<s-1; return 0; }