| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 140395 | 赵德明 | 最长不下降子序列 | C++ | Time Limit Exceeded | 70 | 1000 MS | 1024 KB | 367 | 2024-03-30 14:59:55 |
#include<bits/stdc++.h> using namespace std; int main(){ int a[100005],n,dp[100005],maxn=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; dp[i]=1; } for(int i=1;i<=n;i++){ for(int j=1;j<i;j++){ if(!(a[i]<a[j])){ dp[i]=max(dp[i],dp[j]+1); } } } for(int i=1;i<=n;i++){ maxn=max(maxn,dp[i]); } cout<<maxn; return 0; }