#include <iostream>
using namespace std;
int arr[2000002], s, series[50001];
int main() {
int n, m, a, i;
cin >> n;
for(i = 0; i < n; i++) {
cin >> a;
a += 1000000;
series[i] = a;
if(!arr[a])
s++;
arr[a]++;
}
cin >> m;
if(m < n) {
cout << series[m - 1];
return 0;
}
for(i = n; i < m; i++) {
if(arr[s + 1000000]) {
break;
}
s++;
}
cout << s - (i == m);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
9724 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
9724 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
9724 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
9724 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
9724 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
9724 KB |
Output is correct |
2 |
Correct |
0 ms |
9724 KB |
Output is correct |
3 |
Correct |
0 ms |
9724 KB |
Output is correct |
4 |
Correct |
0 ms |
9724 KB |
Output is correct |
5 |
Correct |
0 ms |
9724 KB |
Output is correct |
6 |
Correct |
0 ms |
9724 KB |
Output is correct |
7 |
Correct |
0 ms |
9724 KB |
Output is correct |
8 |
Correct |
0 ms |
9724 KB |
Output is correct |
9 |
Correct |
0 ms |
9724 KB |
Output is correct |
10 |
Correct |
0 ms |
9724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
9724 KB |
Output is correct |
2 |
Incorrect |
19 ms |
9724 KB |
Output isn't correct |
3 |
Correct |
5 ms |
9724 KB |
Output is correct |
4 |
Correct |
6 ms |
9724 KB |
Output is correct |
5 |
Incorrect |
15 ms |
9724 KB |
Output isn't correct |
6 |
Correct |
21 ms |
9724 KB |
Output is correct |
7 |
Correct |
21 ms |
9724 KB |
Output is correct |
8 |
Incorrect |
24 ms |
9724 KB |
Output isn't correct |
9 |
Correct |
7 ms |
9724 KB |
Output is correct |
10 |
Incorrect |
4 ms |
9724 KB |
Output isn't correct |
11 |
Correct |
9 ms |
9724 KB |
Output is correct |
12 |
Incorrect |
23 ms |
9724 KB |
Output isn't correct |
13 |
Correct |
3 ms |
9724 KB |
Output is correct |
14 |
Incorrect |
12 ms |
9724 KB |
Output isn't correct |
15 |
Correct |
15 ms |
9724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
9724 KB |
Output isn't correct |
2 |
Correct |
27 ms |
9724 KB |
Output is correct |
3 |
Incorrect |
14 ms |
9724 KB |
Output isn't correct |
4 |
Correct |
19 ms |
9724 KB |
Output is correct |
5 |
Incorrect |
12 ms |
9724 KB |
Output isn't correct |
6 |
Correct |
0 ms |
9724 KB |
Output is correct |
7 |
Incorrect |
15 ms |
9724 KB |
Output isn't correct |
8 |
Correct |
4 ms |
9724 KB |
Output is correct |
9 |
Incorrect |
18 ms |
9724 KB |
Output isn't correct |
10 |
Correct |
22 ms |
9724 KB |
Output is correct |
11 |
Incorrect |
17 ms |
9724 KB |
Output isn't correct |
12 |
Incorrect |
19 ms |
9724 KB |
Output isn't correct |
13 |
Incorrect |
10 ms |
9724 KB |
Output isn't correct |
14 |
Incorrect |
14 ms |
9724 KB |
Output isn't correct |
15 |
Correct |
3 ms |
9724 KB |
Output is correct |