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 <stdio.h>
int a[1000010];
int b[1000010];
int main()
{
int i, n, ma;
scanf("%d", &n);
for(i=1 ; i<=n ; i++){
scanf("%d", &a[i]);
}
ma=0;
for(i=1 ; i <=n ; i++){
b[a[i]]=b[a[i]-1]+1;
if(b[a[i]]>=ma)ma=b[a[i]];
}
printf("%d", n-ma);
return 0;
}
# | 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... |