Submission #14111

#TimeUsernameProblemLanguageResultExecution timeMemory
14111ggoh이상한 수열 (OJUZ10_bizarre)C++98
62 / 100
13 ms9112 KiB
#include<cstdio> #include<algorithm> #include<vector> #include<queue> #include<cstring> int a,b,i,s,p,x[55555],c[2000002],M=1000000; main() { scanf("%d",&a); for(i=1;i<=a;i++) { scanf("%d",&x[i]); c[M+x[i]]++; if(c[M+x[i]]==1)s++; } scanf("%d",&b); if(b<=a) { printf("%d",x[b]); return 0; } else { for(i=a+1;i<=b&&i<=2e6+b;i++) { if(c[s+M]==0) { c[s+M]=1; s++; } else { p=1; s++; break; } } printf("%d",s-1); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...