Submission #16619

#TimeUsernameProblemLanguageResultExecution timeMemory
16619eaststar이상한 수열 (OJUZ10_bizarre)C++14
100 / 100
13 ms9728 KiB
#include <bits/stdc++.h> using namespace std; 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)m=min(m,a[i]); printf("%d",m); 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...