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 |
Re:同问求x的算法~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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator