![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
生成树/最优比例生成树
等我学会后缀自动机
侠影之谜
展开
-
UVA 1395 苗条的生成树(水题+Krustrl算法)
#include<iostream>#include<algorithm>#include<string>#include<map>//int dx[4]={0,0,-1,1};int dy[4]={-1,1,0,0};#include<set>//int gcd(int a,int b){return b?gcd(...原创 2018-08-05 12:06:50 · 186 阅读 · 2 评论 -
UVA 1151 买还是建(最小生成树+子集枚举+贪心)
World Wide Networks (WWN) is a leading company that operates large telecommunication networks. WWN would like to setup a new network in Borduria, a nice country that recently managed to get rid of its...原创 2018-08-08 10:17:56 · 334 阅读 · 0 评论 -
HDU 5441 Travel (生成树+并查集)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5441#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x...原创 2018-09-30 01:35:36 · 92 阅读 · 0 评论 -
ZOJ 1914 Arcitc Network(最小生成树+连通性质)
#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll long long#define lrt int l,int r,int rt#define lson l...原创 2019-02-02 22:54:33 · 205 阅读 · 0 评论 -
HDU 4081 Qin Shi Huang's National Road System (最小生成树+DFS)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4081#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define ll uns...原创 2019-02-08 00:47:56 · 141 阅读 · 0 评论