Submission #14154

#TimeUsernameProblemLanguageResultExecution timeMemory
14154dohyun0324이상한 수열 (OJUZ10_bizarre)C++98
0 / 100
37 ms3848 KiB
#include<stdio.h> #include<map> using namespace std; int k,mini=2147483647,x[50010],n,ch[50010]; map<int,int >m; int main() { int i,cnt=0; // freopen("input.txt","r",stdin); scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&x[i]); if(m[x[i]]==0) cnt++; m[x[i]]=1; } for(i=1;i<=n;i++) { if(x[i]>=cnt && mini>x[i]) mini=x[i]; } scanf("%d",&k); if(k>=mini-cnt+1+n) printf("%d",mini); else printf("%d",cnt+k-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...