Submission #14114

#TimeUsernameProblemLanguageResultExecution timeMemory
14114minchurl이상한 수열 (OJUZ10_bizarre)C++98
62 / 100
13 ms8896 KiB
#include<stdio.h> #define N 1000000 int chk[2*N+5],n,m,max,cnt; FILE *in,*out; int main(){ int i,x; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d",&x); if(i==m){ printf("%d\n",x); return 0; } if(chk[x+N]==1) continue; chk[x+N]=1; cnt++; max=max>x?max:x; } scanf("%d",&m); if(cnt>max){ printf("%d\n",cnt+m-n-1); return 0; } while(1){ if(chk[N+cnt]==1 || i==m){ printf("%d\n",cnt); return 0; } chk[N+cnt]=1; cnt++; i++; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...