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 lydliyudong at 2011-05-24 22:01:38 on Problem 3687 and last updated at 2011-05-24 22:02:05
注意此题如果按照一般做法,一定要逆向建图,用大根堆,
贪心时在度为0的点中先找大的出来赋予上大的重量,
千万不能正向建图,然后每次贪心在入度为0的点中找最小的,
比如4-->1,3-->2这个图,如果正向的话先出来的是3,然后是2,然后是4,最后才是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