# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145560 | surface03 | 줄 세우기 (KOI13_jul) | C++14 | 169 ms | 15036 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int a[1000010],b[1000010];
int main(){
int n,x,i,ans=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&x);
a[x]=i;
}
b[1]=1;
for(i=2;i<=n;i++){
if(a[i-1]<a[i])b[i]=b[i-1]+1;
else b[i]=1;
ans=max(ans,b[i]);
}
printf("%d",n-ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |