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 hhgff at 2010-02-07 11:16:41 on Problem 2492
In Reply To:经典并查集! 附代码!只不过时间多了些,但不知为什么能ac Posted by:wangbaobao at 2009-05-17 21:16:54
这2句应该有问题(没试验过):
union_set(find_set(opp[x]),y);
union_set(x,find_set(opp[y]));

x = find_set(x), y = find_set(y);  <--多加这一句
opp[x]=y;
opp[y]=x;


这样肯定过。

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