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 n,c[1100000],i,a,m;
int main(){
for(scanf("%d",&n);i<n;i++)scanf("%d",&a),c[a]=i+1;
for(i=2,a=0;i<=n;i++){
c[i]>c[i-1]?a++:a=0;m=a>m?a:m;
}
printf("%d",n-m-1);
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... |