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:其实本体不是很水。In Reply To:其实本体不是很水。 Posted by:baicaitest at 2009-08-11 13:41:53 > 看排行榜,牛们0ms的代码都很长。难道是什么顺序统计算法?有哪位0ms的贴下代码学习下? #include <iostream> #include<algorithm> using namespace std; int main(int argc, char *argv[]) { int a[10000]={0}; int n=0; cin>>n; for(int i=0;i<n;i++) scanf("%d",&a[i]); sort(a,a+n); cout<<a[(n-1)/2]<<endl; return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator