﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Xredman编程小筑-随笔分类-并查集</title><link>http://www.cppblog.com/xredman/category/10523.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 19 May 2009 06:13:57 GMT</lastBuildDate><pubDate>Tue, 19 May 2009 06:13:57 GMT</pubDate><ttl>60</ttl><item><title>ZOJ1268(Is It A Tree?)</title><link>http://www.cppblog.com/xredman/archive/2009/05/18/83258.html</link><dc:creator>Xredman</dc:creator><author>Xredman</author><pubDate>Mon, 18 May 2009 02:14:00 GMT</pubDate><guid>http://www.cppblog.com/xredman/archive/2009/05/18/83258.html</guid><wfw:comment>http://www.cppblog.com/xredman/comments/83258.html</wfw:comment><comments>http://www.cppblog.com/xredman/archive/2009/05/18/83258.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/xredman/comments/commentRss/83258.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xredman/services/trackbacks/83258.html</trackback:ping><description><![CDATA[<a href="http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=268"><span style="FONT-SIZE: 14pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=268</span></a><br><span style="FONT-SIZE: 14pt; FONT-FAMILY: 楷体_GB2312">&nbsp;&nbsp;&nbsp;2009-05-18 10:04:15 Accepted&nbsp; 1268 C++ 0 （并查集实现）<br>&nbsp;&nbsp;&nbsp;本题要求判定一个有向图是否可以形成一棵树。根据树的定义，一个结点的父亲结点必为一个，一个结点的儿子结点可以有多个。本人采用一个数组记录某个结点是否具有父亲结点，若有多个父亲结点，则不可能形成树，还有就是对于一棵树而言，必定是联通，用并查集判。再考虑空树这种特殊情况就可以了。</span>
<img src ="http://www.cppblog.com/xredman/aggbug/83258.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xredman/" target="_blank">Xredman</a> 2009-05-18 10:14 <a href="http://www.cppblog.com/xredman/archive/2009/05/18/83258.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>HDOJ1198（Farm Irrigation）</title><link>http://www.cppblog.com/xredman/archive/2009/05/11/82598.html</link><dc:creator>Xredman</dc:creator><author>Xredman</author><pubDate>Mon, 11 May 2009 10:10:00 GMT</pubDate><guid>http://www.cppblog.com/xredman/archive/2009/05/11/82598.html</guid><wfw:comment>http://www.cppblog.com/xredman/comments/82598.html</wfw:comment><comments>http://www.cppblog.com/xredman/archive/2009/05/11/82598.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/xredman/comments/commentRss/82598.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xredman/services/trackbacks/82598.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-SIZE: 14pt; FONT-FAMILY: 楷体_GB2312">Accepted 1198 15MS 304K 1768 B C++&nbsp;<br>&nbsp;&nbsp;&nbsp;用并查集判连通。对于二块是否连通的判断貌似有一点技巧可言。用dfs或bfs都可以做。</span> 
<img src ="http://www.cppblog.com/xredman/aggbug/82598.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xredman/" target="_blank">Xredman</a> 2009-05-11 18:10 <a href="http://www.cppblog.com/xredman/archive/2009/05/11/82598.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>