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,x,y[1000001],i,S=1,M;
int main(void)
{
scanf("%d",&N);
for(i=1;i<=N;i++)
{
scanf("%d",&x);
y[x]=i;
}
for(i=1;i<N;i++)
{
if(y[i]>y[i+1])
S=1;
else
{
S++;
if(S>M)
M=S;
}
}
printf("%d",N-M);
}
# | 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... |