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 |
show一下code,欢迎拍砖// sort A[0 ... N-1] first ans = i = 0; j = k = N - 1; N >>= 1; while (N--) { ans += (i64_t)(A[j--] - A[i++]) * k; k -= 2; } the result is (ans << 1). Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator