Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

show一下code,欢迎拍砖

Posted by bpt at 2009-03-08 16:13:53 on Problem 2231 and last updated at 2009-03-08 16:15:00
	// 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator