九度OJ 1004

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
    int m;
    vector<int> vec;
    while(cin >> m)
    {
        int temp;
        for(int i = 0; i < m; ++i)
        {
            cin >> temp;
            vec.push_back(temp);
        }
        cin >> m;
        for(int i = 0; i < m; ++i)
        {
            cin >> temp;
            vec.push_back(temp);
        }
        sort(vec.begin(), vec.end());
        cout << vec[ceil(vec.size() /2.) - 1] << endl;;
        vec.clear();
    }
    return 0;
}

你可能感兴趣的:(九度OJ 1004)