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:怎样用并查集?

Posted by gnocuil at 2008-07-15 08:20:41 on Problem 3631
In Reply To:怎样用并查集? Posted by:huangkun at 2008-07-14 21:21:36
每个hash值作为一个集合,记录每个集合可容纳元素数目,初始为1
将每个词的两个hash值合并,并将容量减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