| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
。。。STL代码#include<iostream>
#include<set>
using namespace std;
int main(int argc, char* argv[])
{
int n,nn,a,sum=0;
multiset<int>ms;
scanf("%d\n",&n);
nn=n;
while(n--)
{scanf("%d",&a);
ms.insert(a);
}
multiset<int>::iterator it=ms.begin();
for(int k=0;;it++)
{
if(k==nn/2)
{ printf("%d\n",*it);break;}
k++;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator