并查集
QQQQQHY
Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway.
—Tanenbaum, Andrew S. (1989).
展开
-
并查集——1073 家族
1073 家族 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 大师 Master 题目描述 Description 若某个家族人员过于庞大,要判断两个是否是亲戚,确实还很不容易,现在给出某个亲戚关系图,求任意给出的两个人是否具有亲戚关系。 规定:x和y是亲戚,y和z是亲戚,那么x和z也是亲戚。如果x,y是亲戚,那么x的亲戚都是y的亲戚,y原创 2016-09-18 15:24:44 · 245 阅读 · 0 评论 -
并查集—1001 舒适的路线题解
调试大法好!#include<iostream> #include<algorithm> #include<cmath> using namespace std; int n,m,f[600],k1,k2; struct edge{ int u,v; double w; }e[6000]; bool operator <(edge a,edge b){ return原创 2016-10-17 20:17:35 · 465 阅读 · 0 评论