#include <cstdio>
#include <set>
using namespace std;
set<int> s;
int n;
int data[50010];
int main()
{
scanf("%d",&n);
int i;
for(i=1;i<=n;++i) scanf("%d",data+i);
int m;
scanf("%d",&m);
if(m<=n){
for(i=1;i<=m;++i) s.insert(data[i]);
printf("%u\n",s.size());
return 0;
}
for(i=1;i<=n;++i) s.insert(data[i]);
m-=n;
for(i=1;m && i<=n;++i){
if(s.find(s.size()) != s.end()){
break;
}
--m;
s.insert(s.size());
}
printf("%d\n",s.size());
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1408 KB |
Output is correct |
2 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
4 |
Correct |
0 ms |
1408 KB |
Output is correct |
5 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
6 |
Correct |
0 ms |
1408 KB |
Output is correct |
7 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
9 |
Correct |
0 ms |
1408 KB |
Output is correct |
10 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
1540 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
3 |
Incorrect |
13 ms |
2068 KB |
Output isn't correct |
4 |
Incorrect |
40 ms |
4972 KB |
Output isn't correct |
5 |
Incorrect |
19 ms |
3256 KB |
Output isn't correct |
6 |
Correct |
0 ms |
1672 KB |
Output is correct |
7 |
Incorrect |
12 ms |
2596 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
9 |
Incorrect |
36 ms |
4180 KB |
Output isn't correct |
10 |
Incorrect |
20 ms |
3124 KB |
Output isn't correct |
11 |
Incorrect |
7 ms |
1408 KB |
Output isn't correct |
12 |
Correct |
0 ms |
1804 KB |
Output is correct |
13 |
Incorrect |
16 ms |
2464 KB |
Output isn't correct |
14 |
Incorrect |
8 ms |
1936 KB |
Output isn't correct |
15 |
Correct |
5 ms |
1804 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
28 ms |
3784 KB |
Output isn't correct |
2 |
Incorrect |
38 ms |
4312 KB |
Output isn't correct |
3 |
Incorrect |
20 ms |
3256 KB |
Output isn't correct |
4 |
Correct |
24 ms |
3388 KB |
Output is correct |
5 |
Incorrect |
29 ms |
3652 KB |
Output isn't correct |
6 |
Incorrect |
27 ms |
3652 KB |
Output isn't correct |
7 |
Incorrect |
6 ms |
1936 KB |
Output isn't correct |
8 |
Correct |
20 ms |
3652 KB |
Output is correct |
9 |
Incorrect |
18 ms |
3124 KB |
Output isn't correct |
10 |
Correct |
2 ms |
1672 KB |
Output is correct |
11 |
Incorrect |
41 ms |
5104 KB |
Output isn't correct |
12 |
Correct |
4 ms |
1804 KB |
Output is correct |
13 |
Incorrect |
7 ms |
2596 KB |
Output isn't correct |
14 |
Incorrect |
0 ms |
1408 KB |
Output isn't correct |
15 |
Correct |
24 ms |
3652 KB |
Output is correct |