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

Re:同问求x的算法~

Posted by wpc0000 at 2006-12-30 11:03:55 on Problem 1723
In Reply To:同问求x的算法~ Posted by:yangguo98l at 2006-12-21 16:48:05
x: 要将所有的x1集中到某个x0。其他xi依次相间1排下去。
先将x排序,可以证明x的顺序一定就是最终的序列的顺序(因为交叉位置的话解更差)。
由于定了序,所以有xi = x0 + i - 1,则可以将问题转化为x'i = xi - (i - 1) = x0。
x'就是与y同样的问题了,求xi - (i - 1)的中位数x0就可以了。

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