#include<stdio.h>
int a[9999];
int N;
int i,j;
int MAX=-1;
int main()
{
scanf("%d",&N);
for(i=1;i<=N;i++)
{
scanf("%d",&j);
a[j]=a[j-1]+1;
if(MAX<a[j])
MAX = a[j];
}
printf("%d\n",N-MAX);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1124 KB |
Output is correct |
2 |
Correct |
0 ms |
1124 KB |
Output is correct |
3 |
Correct |
0 ms |
1124 KB |
Output is correct |
4 |
Correct |
0 ms |
1124 KB |
Output is correct |
5 |
Correct |
0 ms |
1124 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1124 KB |
Output is correct |
2 |
Correct |
0 ms |
1124 KB |
Output is correct |
3 |
Correct |
0 ms |
1124 KB |
Output is correct |
4 |
Correct |
0 ms |
1124 KB |
Output is correct |
5 |
Correct |
0 ms |
1124 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1124 KB |
Output is correct |
2 |
Correct |
0 ms |
1124 KB |
Output is correct |
3 |
Runtime error |
0 ms |
1120 KB |
SIGSEGV Segmentation fault |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
1120 KB |
SIGSEGV Segmentation fault |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
1120 KB |
SIGSEGV Segmentation fault |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
1120 KB |
SIGSEGV Segmentation fault |
2 |
Halted |
0 ms |
0 KB |
- |