| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 140574 | 沈梓珺 | 最长不下降子序列 | C++ | Compile Error | 0 | 0 MS | 0 KB | 417 | 2024-03-30 15:55:25 |
#include<bits/stdc++.h> using namespace std; int a[100005],f[100005],n,longest; int mian(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; if(f[longest]<=a[i]) f[++longest]=a[i]; else{ int L=0,R=longest; while(L<=R){ int mid=(L+R)>>1; if(f[mid]<=a[i]){ L=mid+1; if(f[L]>a[i]) break; } else R=mid-1; } f[L]=a[i]; } } cout<<longest<<endl; return 0; }