Submission #1106

#TimeUsernameProblemLanguageResultExecution timeMemory
1106hana5505줄 세우기 (KOI13_jul)C++98
22 / 22
196 ms8696 KiB
#include<stdio.h> int ar[1000001]; int aa[1000001]; int main() { int n,i,b,mx=0,cnt=0; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d",&ar[i]); aa[ar[i]]=i; } cnt=1; b=aa[1]; for(i=2;i<=n;i++){ if(b<aa[i]) cnt++; else{ if(cnt>mx) mx=cnt; cnt=1; } b=aa[i]; } printf("%d",n-mx); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...