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

不是这样的

Posted by lsz2008 at 2008-06-03 16:29:01 on Problem 2010
In Reply To:Re:按score排序,,依次向下枚举中位数,在中位数上下两段各找出[n/2]个aid加起来最小的。。就用堆吧。。STL表现不错。185ms Posted by:y07yangruilong at 2008-03-13 20:43:01
按照score从高到低排序(高的在左面),再用一个堆和一个类似链表的东西。用堆存左面的N div 2个aid最小的,链表按照aid从小到大存右面的所有的,中间留一个。然后每次从右面拿一个score最大的弄出来,把原来中间的那个放到左面,然后更新一下……大概就这意思……

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