随笔分类 - 图论——最小生成树
摘要:题目链接:http://acm.hrbeu.edu.cn/index.php?act=problem&id=1223 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 #define maxn 11510 using namespace std;11 12 const int INF = 0x3f3f3f;13 14 struct Point{15 double x,y;16 bool operator G[s][i]){46 ...
阅读全文
摘要:好蛋疼啊,由于double 不能用memset,害的我调了一个多小时才发现。由于用二分搜索,时间有点大#include #include #include #include #define maxn 1005using namespace std;const int INF = 0x3f3f3f;struct node{ int x,y,z;}Node[maxn];double d[maxn];double G[maxn][maxn];double cost[maxn][maxn];double benefit[maxn][maxn]; int n;double mid,ans;void c.
阅读全文
摘要:本题本是模板题,但由于开始并查集写出,好不容易发现了,有没改彻底,导致狂WA,以后一定要注意,修改后要多检查,别急忙交;#include #include #include #include #define maxn 105using namespace std;const int INF = 0x3f3f3f;int G[maxn][maxn];struct Edge{ int from; int to; int len; bool operator >N){ memset(G,0,sizeof(G)); Slover.init(N); ...
阅读全文