# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
8448 | adream | 줄 세우기 (KOI13_jul) | C++14 | 12 ms | 1676 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |