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 |
Re:What's Wrong?In Reply To:What's Wrong? Posted by:songuno1 at 2005-12-25 22:46:24 > #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