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

stl水过...上代码

Posted by Javran at 2010-08-04 22:36:21 on Problem 2388
#include <cstdio>
#include <algorithm>

int d[10010];
int n;

int main()
{
	int i;
	scanf("%d",&n);
	for (i=0;i<n;++i)
		scanf("%d",&d[i]);
	std::nth_element(d,d+n/2,d+n);
	printf("%d\n",d[n/2]);
}

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