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 |
lld->I64d , See FAQ..In Reply To:sos!!! Posted by:jimi at 2007-11-01 09:07:21 > 主程: > 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