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 |
sos!!!主程: for(i=0;i<n;i++) scanf("%ld",&a[i]); qsort(a,n,sizeof(long),cmp); n = (n-1) * 2; sum = 0; for(i=0,k=0,j=n;i<=n;i+=2,j-=2,k++) sum+=a[k]*(i-j); printf("%lld\n",sum); !~~~~ Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator