#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
5384 KB |
Output is correct |
2 |
Correct |
0 ms |
5384 KB |
Output is correct |
3 |
Correct |
0 ms |
5384 KB |
Output is correct |
4 |
Correct |
0 ms |
5384 KB |
Output is correct |
5 |
Correct |
0 ms |
5384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
5384 KB |
Output is correct |
2 |
Correct |
0 ms |
5384 KB |
Output is correct |
3 |
Correct |
0 ms |
5384 KB |
Output is correct |
4 |
Correct |
0 ms |
5384 KB |
Output is correct |
5 |
Correct |
0 ms |
5384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
5384 KB |
Output is correct |
2 |
Correct |
0 ms |
5384 KB |
Output is correct |
3 |
Correct |
0 ms |
5384 KB |
Output is correct |
4 |
Correct |
0 ms |
5384 KB |
Output is correct |
5 |
Correct |
0 ms |
5384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
5384 KB |
Output is correct |
2 |
Correct |
4 ms |
5384 KB |
Output is correct |
3 |
Correct |
12 ms |
5384 KB |
Output is correct |
4 |
Correct |
20 ms |
5384 KB |
Output is correct |
5 |
Correct |
44 ms |
5384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
76 ms |
5384 KB |
Output is correct |
2 |
Correct |
112 ms |
5384 KB |
Output is correct |
3 |
Correct |
116 ms |
5384 KB |
Output is correct |
4 |
Correct |
148 ms |
5384 KB |
Output is correct |
5 |
Correct |
172 ms |
5384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
148 ms |
5384 KB |
Output is correct |
2 |
Correct |
164 ms |
5384 KB |
Output is correct |
3 |
Correct |
156 ms |
5384 KB |
Output is correct |
4 |
Correct |
152 ms |
5384 KB |
Output is correct |
5 |
Correct |
168 ms |
5384 KB |
Output is correct |