摘要: POJ1456 这个题一看好像就是用贪心做啊,一个结构体,拍一下序,vis数组一遍遍扫荡,最后输出值,没错,贪心的确能做出来,而这类题目也能应用并查集,实现得思想也是贪心 #include <iostream> #include <string.h> #include <cstdio> #inclu 阅读全文
posted @ 2018-03-21 21:28 Butterflier 阅读(131) 评论(0) 推荐(0) 编辑
摘要: POJ1182 HDU3038 这两个题比较像(一类题目),属于带权(种类)并查集 poj1182描绘得三种动物种类的关系,按照他一开始给你的关系,优化你的种类关系网络,最后看看再优化的过程中有几处矛盾 #include <iostream> #include <string.h> #include 阅读全文
posted @ 2018-03-21 21:17 Butterflier 阅读(151) 评论(0) 推荐(0) 编辑