Submission #5251

#TimeUsernameProblemLanguageResultExecution timeMemory
5251jihoon줄 세우기 (KOI13_jul)C++98
0 / 22
152 ms8900 KiB
#include<cstdio> int mx=1; int dp[1000001][2]={0}; int main(){ int n,i,ia; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&dp[i][0]); } dp[0][1]=1; for(i=1;i<n;i++){ if(dp[i][0]>dp[i-1][0]&&(dp[i][0]!=n||i==n-1)&&dp[i][0]!=1){ dp[i][1]=dp[i-1][1]+1; if(mx<dp[i][1]) mx=dp[i][1]; }else{ dp[i][1]=1; } } 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...