#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]);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 time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
9092 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
9092 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
9092 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
9092 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
9092 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
9092 KB |
Output is correct |
2 |
Correct |
0 ms |
9092 KB |
Output is correct |
3 |
Correct |
0 ms |
9092 KB |
Output is correct |
4 |
Correct |
0 ms |
9092 KB |
Output is correct |
5 |
Correct |
0 ms |
9092 KB |
Output is correct |
6 |
Correct |
0 ms |
9092 KB |
Output is correct |
7 |
Correct |
0 ms |
9092 KB |
Output is correct |
8 |
Correct |
0 ms |
9092 KB |
Output is correct |
9 |
Correct |
0 ms |
9092 KB |
Output is correct |
10 |
Correct |
0 ms |
9092 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9092 KB |
Output is correct |
2 |
Correct |
3 ms |
9092 KB |
Output is correct |
3 |
Correct |
2 ms |
9092 KB |
Output is correct |
4 |
Correct |
4 ms |
9092 KB |
Output is correct |
5 |
Incorrect |
13 ms |
9092 KB |
Output isn't correct |
6 |
Correct |
0 ms |
9092 KB |
Output is correct |
7 |
Incorrect |
6 ms |
9092 KB |
Output isn't correct |
8 |
Incorrect |
6 ms |
9092 KB |
Output isn't correct |
9 |
Incorrect |
7 ms |
9092 KB |
Output isn't correct |
10 |
Correct |
4 ms |
9092 KB |
Output is correct |
11 |
Correct |
0 ms |
9092 KB |
Output is correct |
12 |
Correct |
9 ms |
9092 KB |
Output is correct |
13 |
Incorrect |
2 ms |
9092 KB |
Output isn't correct |
14 |
Incorrect |
5 ms |
9092 KB |
Output isn't correct |
15 |
Correct |
6 ms |
9092 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
9092 KB |
Output is correct |
2 |
Correct |
0 ms |
9092 KB |
Output is correct |
3 |
Correct |
9 ms |
9092 KB |
Output is correct |
4 |
Correct |
2 ms |
9092 KB |
Output is correct |
5 |
Correct |
0 ms |
9092 KB |
Output is correct |
6 |
Correct |
1 ms |
9092 KB |
Output is correct |
7 |
Correct |
5 ms |
9092 KB |
Output is correct |
8 |
Correct |
5 ms |
9092 KB |
Output is correct |
9 |
Correct |
5 ms |
9092 KB |
Output is correct |
10 |
Correct |
0 ms |
9092 KB |
Output is correct |
11 |
Correct |
4 ms |
9092 KB |
Output is correct |
12 |
Correct |
0 ms |
9092 KB |
Output is correct |
13 |
Correct |
9 ms |
9092 KB |
Output is correct |
14 |
Correct |
13 ms |
9092 KB |
Output is correct |
15 |
Correct |
5 ms |
9092 KB |
Output is correct |