#include<stdio.h>
int num[1000001];
int main(){
int N,i,a,max=0;
scanf("%d",&N);
for(i=1; i<=N; i++){
scanf("%d",&a);
num[a]=num[a-1]+1;
if(max<num[a])max=num[a];
}
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 |
24 ms |
4992 KB |
Output is correct |
5 |
Correct |
48 ms |
4992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
68 ms |
4992 KB |
Output is correct |
2 |
Correct |
108 ms |
4992 KB |
Output is correct |
3 |
Correct |
116 ms |
4992 KB |
Output is correct |
4 |
Correct |
160 ms |
4992 KB |
Output is correct |
5 |
Correct |
148 ms |
4992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
140 ms |
4992 KB |
Output is correct |
2 |
Correct |
156 ms |
4992 KB |
Output is correct |
3 |
Correct |
148 ms |
4992 KB |
Output is correct |
4 |
Correct |
164 ms |
4992 KB |
Output is correct |
5 |
Correct |
152 ms |
4992 KB |
Output is correct |