Submission #8448

#TimeUsernameProblemLanguageResultExecution timeMemory
8448adream줄 세우기 (KOI13_jul)C++14
0 / 22
12 ms1676 KiB
#include <iostream> #include <cstring> using namespace std; int n; int a[201], cache[201]; int lis(int b){ int&ret=cache[b]; if(ret!=-1) return ret; ret=1; for(int i=b+1; i<n; ++i){ if(a[b]<a[i]) ret=max(ret, lis(i)+1); } return ret; } int main(){ scanf("%d", &n); memset(cache, -1, sizeof(cache)); for(int i=0; i<n; ++i) scanf("%d",&a[i]); int ans=-1; for(int i=0; i<n; ++i) ans=max(ans,lis(i)); printf("%d\n", n-ans); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...