#include <stdio.h>
int n,t,d[1000001],i,max=0;
int main(){
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&t);
d[t]=d[t-1]+1;
if(max<d[t])max=d[t];
}
printf("%d",n-max);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
4992 KB |
Output is correct |
2 |
Correct |
0 ms |
4992 KB |
Output is correct |
3 |
Correct |
0 ms |
4992 KB |
Output is correct |
4 |
Correct |
0 ms |
4992 KB |
Output is correct |
5 |
Correct |
0 ms |
4992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
4992 KB |
Output is correct |
2 |
Correct |
0 ms |
4992 KB |
Output is correct |
3 |
Correct |
0 ms |
4992 KB |
Output is correct |
4 |
Correct |
0 ms |
4992 KB |
Output is correct |
5 |
Correct |
0 ms |
4992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
4992 KB |
Output is correct |
2 |
Correct |
0 ms |
4992 KB |
Output is correct |
3 |
Correct |
0 ms |
4992 KB |
Output is correct |
4 |
Correct |
0 ms |
4992 KB |
Output is correct |
5 |
Correct |
0 ms |
4992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
4992 KB |
Output is correct |
2 |
Correct |
4 ms |
4992 KB |
Output is correct |
3 |
Correct |
12 ms |
4992 KB |
Output is correct |
4 |
Correct |
28 ms |
4992 KB |
Output is correct |
5 |
Correct |
48 ms |
4992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
76 ms |
4992 KB |
Output is correct |
2 |
Correct |
100 ms |
4992 KB |
Output is correct |
3 |
Correct |
132 ms |
4992 KB |
Output is correct |
4 |
Correct |
164 ms |
4992 KB |
Output is correct |
5 |
Correct |
156 ms |
4992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
168 ms |
4992 KB |
Output is correct |
2 |
Correct |
144 ms |
4992 KB |
Output is correct |
3 |
Correct |
164 ms |
4992 KB |
Output is correct |
4 |
Correct |
156 ms |
4992 KB |
Output is correct |
5 |
Correct |
164 ms |
4992 KB |
Output is correct |