Submission #14207

#TimeUsernameProblemLanguageResultExecution timeMemory
14207khsoo01이상한 수열 (OJUZ10_bizarre)C++98
100 / 100
11 ms9092 KiB
#include<cstdio> #define min(X,Y)(X<Y?X:Y) int i,n,m,c,a[50005],d[2000005]; int main() { scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); if(!d[a[i]+1000000]) { d[a[i]+1000000]=1; c++; } } scanf("%d",&m); if(m<=n){printf("%d",a[m-1]);return 0;} m=c+m-n-1; for(i=0;i<n;i++) { if(a[i]>=c && a[i]<=m) { m=min(a[i],m); } } printf("%d",m); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...