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 |
What's Wrong?#include <stdio.h> #include <algorithm> using namespace std; int N; int D[250000]; int main (){ int i; scanf ( "%d", &N ); for (i=0; i<N; i++) scanf ( "%d", &D[i] ); sort ( D, D+N ); if (N%2) printf ( "%d", D[N/2] ); else{ if ((D[N/2]+D[N/2-1])%2==0) printf ( "%d", (D[N/2]+D[N/2-1])/2 ); else printf ( "%.1lf", (double)(D[N/2]+D[N/2-1])/2 ); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator