
并查集
文章平均质量分 78
shengweisong
只有行动,才能解除所有的不安
展开
-
hdoj 1325 Is It A Tree? 【并查集】
做了一上午,终于ac了 wa了一次主要是忘了还有环!!! 主要是运用并查集知识,又复习了一次!!思路:输入之后找能不能成环,成环就不是,其次还要判断是不是有两个父节点,如果有两个父节点也不是,之后就找相关的祖先就好了;还要注意:如果只有一个节点,也是树,如果有两个或多个根节点也不是树;如果没有根节点也不是链接http://acm.hdu.edu.cn/showproblem.php原创 2014-06-24 14:02:14 · 1036 阅读 · 1 评论 -
poj 1611 The Suspects 【并查集】
The SuspectsTime Limit: 1000MS Memory Limit: 20000K Total Submissions: 24570 Accepted: 12033 DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was rec原创 2015-04-09 16:16:19 · 734 阅读 · 0 评论 -
Hdoj 4496 D-City 【并查集】
D-CityTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 2134 Accepted Submission(s): 751Problem Description Luxer is a really bad guy. He des原创 2015-04-23 22:25:51 · 873 阅读 · 0 评论 -
poj 1703 Find them, Catch them 【并查集拓展】
Find them, Catch themTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 32514 Accepted: 10036DescriptionThe police office in Tadu City decides to say end原创 2014-12-06 13:38:05 · 986 阅读 · 0 评论 -
poj 2492 A Bug's Life 【并查集拓展】
A Bug's LifeTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 29030 Accepted: 9455DescriptionBackground Professor Hopper is researching the sexual be原创 2014-12-06 13:35:03 · 834 阅读 · 0 评论 -
hdoj 1811 Rank of Tetris 【拓扑】+【并查集】
Rank of TetrisTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5428 Accepted Submission(s): 1520Problem Description自从Lele开发了Ra原创 2014-11-18 23:40:29 · 956 阅读 · 0 评论 -
poj 2236 Wireless Network 【并查集】
Wireless NetworkTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 16832 Accepted: 7068DescriptionAn earthquake takes place in Southeast Asia. The ACM (原创 2014-11-18 01:03:49 · 1358 阅读 · 0 评论 -
hdoj 1116 Play on Words 【并查集】+【欧拉路】
Play on WordsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5622 Accepted Submission(s): 1850Problem DescriptionSome of the原创 2014-11-14 00:30:52 · 2011 阅读 · 0 评论 -
hdoj 1598 find the most comfortable road 【并查集】+【暴力枚举】
find the most comfortable roadTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4022 Accepted Submission(s): 1732Problem Descript原创 2014-11-13 00:06:03 · 1545 阅读 · 0 评论 -
nyoj42 一笔画问题 并查集加欧拉回路
原来想的只是个简单欧拉回路问题原创 2014-05-23 15:37:50 · 789 阅读 · 0 评论 -
hdoj 1232 畅通工程 【并查集】
策略: 如题。并查集:并查集是一种树型的数据结构,用于处理一些不相交集合(Disjoint Sets)的合并及查询问题。 说白了就是点的合并与查询。题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1232代码:#include#includeint fat[1005];int f(int n){ if(fat[n] !=原创 2014-08-02 21:29:28 · 795 阅读 · 0 评论 -
Hdoj 1213 How Many Tables 【并查集】
How Many Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 16590 Accepted Submission(s): 8117Problem DescriptionToday is Ignatius’ bir原创 2015-04-17 20:29:45 · 950 阅读 · 0 评论