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<cstdio>
int mx=1;
int dp[1000001][2]={0};
int main(){
int n,i,ia;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&dp[i][0]);
}
dp[0][1]=1;
for(i=1;i<n;i++){
if(dp[i][0]>dp[i-1][0]&&(dp[i][0]!=n||i==n-1)&&dp[i][0]!=1){
dp[i][1]=dp[i-1][1]+1;
if(mx<dp[i][1]) mx=dp[i][1];
}else{
dp[i][1]=1;
}
}
printf("%d",n-mx);
}
# | 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... |