#import<cstdio>
int n,a,v[1000005],mx;
int main()
{
int i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a);
v[a]=v[a-1]+1;
if(v[a]>mx)mx=v[a];
}
printf("%d",n-mx);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
4988 KB |
Output is correct |
2 |
Correct |
0 ms |
4988 KB |
Output is correct |
3 |
Correct |
0 ms |
4988 KB |
Output is correct |
4 |
Correct |
0 ms |
4988 KB |
Output is correct |
5 |
Correct |
0 ms |
4988 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
4988 KB |
Output is correct |
2 |
Correct |
0 ms |
4988 KB |
Output is correct |
3 |
Correct |
0 ms |
4988 KB |
Output is correct |
4 |
Correct |
0 ms |
4988 KB |
Output is correct |
5 |
Correct |
0 ms |
4988 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
4988 KB |
Output is correct |
2 |
Correct |
0 ms |
4988 KB |
Output is correct |
3 |
Correct |
4 ms |
4988 KB |
Output is correct |
4 |
Correct |
5 ms |
4988 KB |
Output is correct |
5 |
Correct |
0 ms |
4988 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
4988 KB |
Output is correct |
2 |
Correct |
6 ms |
4988 KB |
Output is correct |
3 |
Correct |
14 ms |
4988 KB |
Output is correct |
4 |
Correct |
32 ms |
4988 KB |
Output is correct |
5 |
Correct |
0 ms |
4988 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
80 ms |
4988 KB |
Output is correct |
2 |
Correct |
100 ms |
4988 KB |
Output is correct |
3 |
Correct |
54 ms |
4988 KB |
Output is correct |
4 |
Correct |
156 ms |
4988 KB |
Output is correct |
5 |
Correct |
159 ms |
4988 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
166 ms |
4988 KB |
Output is correct |
2 |
Correct |
127 ms |
4988 KB |
Output is correct |
3 |
Correct |
114 ms |
4988 KB |
Output is correct |
4 |
Correct |
90 ms |
4988 KB |
Output is correct |
5 |
Correct |
153 ms |
4988 KB |
Output is correct |