标签:des style blog color strong width
| Time Limit: 1000MS | Memory Limit: 65536K | |
| Total Submissions: 31149 | Accepted: 18073 |
Description
Input
Output
Sample Input
5 2 4 1 3 5
Sample Output
3
#include<stdio.h>
#include<algorithm>
using namespace std;
int cmp(int x,int y)
{
if(x<y) return 1;
else return 0;
}
int main ()
{
int n,t,i,j;
int a[1000005];
while (~scanf("%d",&n))
{
for(i=0;i<n;i++)
scanf("%d",&a[i]);
sort(a,a+n,cmp);
if(n%2==0) t=(n/2)-1;
else t=n/2;
printf("%d\n",a[t]);
}
return 0;
}
poj 2388 Who's in the Middle,布布扣,bubuko.com
标签:des style blog color strong width
原文地址:http://blog.csdn.net/fyxz1314/article/details/37535393