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:同志们:利用并查集是错的,我用并查集也AC了,但是仔细研究后,发现是错了,数据太弱了

Posted by tangcong506 at 2011-10-30 18:25:00 on Problem 1308
In Reply To:同志们:利用并查集是错的,我用并查集也AC了,但是仔细研究后,发现是错了,数据太弱了 Posted by:735612658 at 2011-09-04 17:53:26
的确。。举一个简单的例子
下面这组数据用并查集做是tree.
2 1 3 1 4 1 5 1
明显不是tree.
正解的解法应该是利用树的性质。。
       拓扑排序:

          (1)排除环的存在

          (2)除了一个节点(root)其余各节点的入度为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