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 wplxb at 2007-07-14 12:08:52 on Problem 2439
我的思路:
为三种颜色的边各建一个链表
用 Kruskal 算法,循环加不同颜色的边:红、绿、蓝、红、绿、蓝...
如果在加某个颜色的边时链表中当前边不是最小生成树的树边,找链表中下一个元素;如果链表到尾部了,算法中止

这样有问题吗?

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