Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

还需要重写cmp么。。。直接用sort秒过

Posted by Debaucher at 2013-03-08 00:42:17 on Problem 2388
In Reply To:附代码吧!so easy!!! Posted by:chenxuan123456789 at 2012-11-04 21:25:18
#include "iostream"
#include "algorithm"
using namespace std;
#define MAX 10000
int milk[MAX];

int main()
{
    int T,i=0;
    cin>>T;
    for (i=0;i<T;i++)
    cin>>milk[i];
    sort(milk,milk+T);
    int middle=(T-1)/2;
    cout<<milk[middle]<<endl;
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator