//题意:给定一组数,求中位数
//思路:直接快排
#include <iostream> #include <algorithm> using namespace std; bool cmp(const int a, const int b) { return a < b; } int main() { ios :: sync_with_stdio(false); cin.tie(0); int t; while(cin >> t){ int *n = new int [t]; for(int i = 0; i < t; i++) cin >> n[i]; sort(n, n+t, cmp); if(t & 1){ cout << n[t/2] << endl; }else cout << n[t/2-1] << endl; } return 0; }