HDU 1863
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1863复习考研练练写Prim,第一次写,乱搞的,有点难看邻接表+堆#include #include #include #include using namespace std;int n, m, cnt, ct,...
阅读全文
HDU 1102 Constructing Roads
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1102最简单的最小生成树View Code #include #include #include int p[110];int cnt,n; typedef struct L{ int a,b,d; }L...
阅读全文
HDU 1162 Eddy's picture
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1162最简单的最小生成树。。。View Code #include #include #include int p[110];int cnt,n; typedef struct L{ int a,b; ...
阅读全文
HDU 1301 Jungle Roads
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1301最简单的最小生成树View Code #include #include int p[30];int cnt,n; typedef struct L{ int a,b,d;}L;L r[1000]; ...
阅读全文
HDU 1879 继续畅通工程
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1879最小生成树。。。m,n又看反了。。。无语ingView Code #include #include #include int idx[1000000];struct node{ int a,b,cos...
阅读全文
HDU 1863 畅通工程
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1863裸的最小生成树,只需多判断一下是否连通,我用的方法是看是否只有一个根节点。ps:m和n写反了,害我查了1h啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊View Code #include #include #include...
阅读全文
HDU 1233 还是畅通工程
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1233最小生成树,查找根节点的函数里面等号写成赋值号,查了半个小时、、、View Code #include #include #define N 110int idx[N];struct node{ int...
阅读全文