Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 838 Bytes

1029.md

File metadata and controls

49 lines (39 loc) · 838 Bytes

1029

Accepted

#include <cstdio>
#include <algorithm>
using namespace std;

const int MAX_N = 2 * 2 * 1e5 + 5;
long int a[MAX_N];

int main() {
	int n1, n2;
	scanf("%d", &n1);
	for (int i = 0; i < n1; i++) {
		scanf("%ld", &a[i]);
	}
	scanf("%d", &n2);
	for (int i = n1; i < n1 + n2; i++) {
		scanf("%ld", &a[i]);
	}
	/*
	for (int i = 0; i < n1 + n2; i++) {
		cout << a[i] << " ";
	}
	cout << endl;
	// */
	sort(a, a + n1 + n2);
	printf("%ld\n", a[(n1 + n2 - 1) / 2]);
}

/*
Sample Input:
4 11 12 13 14
5 9 10 15 16 17
Sample Output:
13
*/

References