Submission #16618

#TimeUsernameProblemLanguageResultExecution timeMemory
16618eaststar이상한 수열 (OJUZ10_bizarre)C++14
8 / 100
21 ms9092 KiB
#include <stdio.h> int a[50010],chk[2000010],s; int main(){ int i,n,m; scanf("%d",&n); for(i=1;i<=n;++i){ scanf("%d",a+i); if(!chk[a[i]+1000000])chk[a[i]+1000000]=1,++s; } scanf("%d",&m); if(m<=n){ printf("%d",a[m]); return 0; } m-=n-s+1; for(i=1;i<=n;++i)if(s<=a[i]&&a[i]<=m)break; if(i>n)printf("%d",m); else printf("%d",a[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...