Submission #14034

#TimeUsernameProblemLanguageResultExecution timeMemory
14034paulsohn이상한 수열 (OJUZ10_bizarre)C++98
62 / 100
14 ms1280 KiB
#include <cstdio> #include <algorithm> using namespace std; int N, M, d=1; int S[50050]; int main() { int i; scanf("%d",&N); for(i=1;i<=N;++i) scanf("%d",S+i); scanf("%d",&M); sort(S+1,S+N+1); for(i=1;i<N;++i) if(S[i]!=S[i+1]) ++d; for(i=1;i<=N;++i) if(d<=S[i]) break; S[N+1]=0x7FFFFFFF; printf("%d",min(S[i],d+M-N-1)); 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...