#include <stdio.h>
int a[1000010];
int b[1000010];
int main()
{
int i, n, ma;
scanf("%d", &n);
for(i=1 ; i<=n ; i++){
scanf("%d", &a[i]);
}
ma=0;
for(i=1 ; i <=n ; i++){
b[a[i]]=b[a[i]-1]+1;
if(b[a[i]]>=ma)ma=b[a[i]];
}
printf("%d", n-ma);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
8900 KB |
Output is correct |
2 |
Correct |
0 ms |
8900 KB |
Output is correct |
3 |
Correct |
0 ms |
8900 KB |
Output is correct |
4 |
Correct |
0 ms |
8900 KB |
Output is correct |
5 |
Correct |
0 ms |
8900 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
8900 KB |
Output is correct |
2 |
Correct |
0 ms |
8900 KB |
Output is correct |
3 |
Correct |
0 ms |
8900 KB |
Output is correct |
4 |
Correct |
0 ms |
8900 KB |
Output is correct |
5 |
Correct |
0 ms |
8900 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
8900 KB |
Output is correct |
2 |
Correct |
0 ms |
8900 KB |
Output is correct |
3 |
Correct |
0 ms |
8900 KB |
Output is correct |
4 |
Correct |
0 ms |
8900 KB |
Output is correct |
5 |
Correct |
0 ms |
8900 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
8900 KB |
Output is correct |
2 |
Correct |
4 ms |
8900 KB |
Output is correct |
3 |
Correct |
12 ms |
8900 KB |
Output is correct |
4 |
Correct |
20 ms |
8900 KB |
Output is correct |
5 |
Correct |
48 ms |
8900 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
60 ms |
8900 KB |
Output is correct |
2 |
Correct |
96 ms |
8900 KB |
Output is correct |
3 |
Correct |
120 ms |
8900 KB |
Output is correct |
4 |
Correct |
132 ms |
8900 KB |
Output is correct |
5 |
Correct |
144 ms |
8900 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
136 ms |
8900 KB |
Output is correct |
2 |
Correct |
152 ms |
8900 KB |
Output is correct |
3 |
Correct |
140 ms |
8900 KB |
Output is correct |
4 |
Correct |
148 ms |
8900 KB |
Output is correct |
5 |
Correct |
148 ms |
8900 KB |
Output is correct |