#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1604 KB |
Output is correct |
2 |
Correct |
0 ms |
1604 KB |
Output is correct |
3 |
Correct |
0 ms |
1604 KB |
Output is correct |
4 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
6 |
Correct |
0 ms |
1604 KB |
Output is correct |
7 |
Correct |
0 ms |
1604 KB |
Output is correct |
8 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
10 |
Correct |
0 ms |
1604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
28 ms |
3056 KB |
Output isn't correct |
2 |
Incorrect |
31 ms |
3584 KB |
Output isn't correct |
3 |
Incorrect |
14 ms |
1604 KB |
Output isn't correct |
4 |
Incorrect |
4 ms |
1604 KB |
Output isn't correct |
5 |
Incorrect |
5 ms |
1604 KB |
Output isn't correct |
6 |
Incorrect |
34 ms |
3848 KB |
Output isn't correct |
7 |
Incorrect |
22 ms |
2132 KB |
Output isn't correct |
8 |
Correct |
3 ms |
1868 KB |
Output is correct |
9 |
Correct |
2 ms |
2000 KB |
Output is correct |
10 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
11 |
Correct |
0 ms |
2000 KB |
Output is correct |
12 |
Incorrect |
6 ms |
1604 KB |
Output isn't correct |
13 |
Incorrect |
3 ms |
1604 KB |
Output isn't correct |
14 |
Incorrect |
33 ms |
3848 KB |
Output isn't correct |
15 |
Incorrect |
4 ms |
1604 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2000 KB |
Output is correct |
2 |
Correct |
35 ms |
3848 KB |
Output is correct |
3 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
4 |
Correct |
37 ms |
3848 KB |
Output is correct |
5 |
Incorrect |
24 ms |
2132 KB |
Output isn't correct |
6 |
Incorrect |
26 ms |
3056 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
1604 KB |
Output isn't correct |
8 |
Incorrect |
10 ms |
1604 KB |
Output isn't correct |
9 |
Correct |
0 ms |
1604 KB |
Output is correct |
10 |
Correct |
31 ms |
3584 KB |
Output is correct |
11 |
Incorrect |
4 ms |
1604 KB |
Output isn't correct |
12 |
Incorrect |
5 ms |
1604 KB |
Output isn't correct |
13 |
Incorrect |
6 ms |
1604 KB |
Output isn't correct |
14 |
Correct |
0 ms |
1868 KB |
Output is correct |
15 |
Incorrect |
7 ms |
1604 KB |
Output isn't correct |