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

float -->double 就过了,

Posted by ajioy at 2011-07-25 11:09:28 on Problem 2623
#include <stdio.h>
#include <stdlib.h>

int cmp(const void *a,const void *b)
{
	return *(int *)a-*(int *)b;
}

int main()
{
    int num[250001];
    int n,i,m;
    double ans;
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",num+i);
    qsort(num,n,sizeof(int),cmp);
    m=n/2;
    printf("%.1lf",n%2?num[m]:num[m]/2.0+num[m-1]/2.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