随笔分类 -  最小生成树

1
摘要:#include<algorithm> #include<iostream> #include<cstdlib> #include<cstring> #include<cctype> #include<cstdio> #include<vector> #include<string> #includ 阅读全文
posted @ 2020-07-26 12:59 晴屿 编辑
摘要:```#include#include#include#include#include#includeusing namespace std;#define x first#define y secondtypedef pairpii;const int N=5050;const int INF=1e9;pii p[N];double dist[N];bool vis[N];int n;doubl... 阅读全文
posted @ 2020-05-13 15:11 晴屿 编辑
摘要:```//稠密图#include #include #include using namespace std;const int N = 100010, M = 200010, INF = 0x3f3f3f3f;int n, m;int p[N];struct Edge { int a, b, w; bool operator< (const Edge &W)const { ... 阅读全文
posted @ 2020-05-12 13:37 晴屿 编辑
摘要:#include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=2e5+10; int n,m; int p[N]; struct edge{ int a,b; int w; }e[N 阅读全文
posted @ 2020-02-08 17:56 晴屿 编辑
摘要:#include<iostream> #include<algorithm> #include<cstring> #include<cmath> using namespace std; #define x first #define y second const int N=210; typede 阅读全文
posted @ 2020-01-29 16:59 晴屿 编辑
摘要:#include<stdio.h> #include<string.h> #include<iostream> using namespace std; const int N=30; int map[N][N]; bool vis[N]; void Prim(int n) { int len=0, 阅读全文
posted @ 2020-01-29 16:11 晴屿 编辑
摘要:#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=110; int p[N],n,m,ans,num; struct node { in 阅读全文
posted @ 2020-01-29 15:29 晴屿 编辑
摘要:#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; const int N=510,M=10010; int 阅读全文
posted @ 2020-01-29 15:22 晴屿 编辑
摘要:#include<iostream> #include<stdio.h> #include<cstring> #include<queue> using namespace std; typedef pair<int,int>PII; //原地图 char g[100][100]; int n,m; 阅读全文
posted @ 2020-01-29 15:18 晴屿 编辑
摘要:#include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=110; #define inf 1<<29 int map[N][N],n; int dist[N]; bool st[N] 阅读全文
posted @ 2020-01-29 14:58 晴屿 编辑
摘要:#include<iostream> #include<cstdio> #include<cmath> #include<algorithm> using namespace std; const int maxn=800; int n,m,tot,u,v; int pre[maxn]; //存点 阅读全文
posted @ 2020-01-29 14:45 晴屿 编辑
摘要:#include<cstring> #include<iostream> #include<algorithm> #include<cmath> #include<cstdio> #define x first #define y second using namespace std; typede 阅读全文
posted @ 2020-01-29 14:12 晴屿 编辑
摘要:#include<iostream> #include<cstring> #include<algorithm> #include<stdio.h> using namespace std; const int INF=0x3f3f3f3f; const int N=2010; int n; int 阅读全文
posted @ 2020-01-29 14:02 晴屿 编辑
摘要:#include<iostream> #include<algorithm> using namespace std; const int N=1e6+10; struct edge{ int a,b; double w; }e[N]; int p[N]; int a[N]; int n; bool 阅读全文
posted @ 2020-01-29 13:46 晴屿 编辑
摘要:#include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=110; int p[N]; struct edge{ int a; int b; int w; }e[N*N]; in 阅读全文
posted @ 2020-01-29 13:14 晴屿 编辑
摘要:#include<iostream> #include<cmath> #include<algorithm> #include<cstdio> using namespace std; const int N=1e5; struct edge{ int a,b; double w; }e[N]; d 阅读全文
posted @ 2020-01-29 12:52 晴屿 编辑
摘要:#include<iostream> #include<algorithm> using namespace std; const int N=1e5; struct edge{ int a,b,w; }e[N]; bool cmp(edge a,edge b) { return a.w<b.w; 阅读全文
posted @ 2020-01-29 11:19 晴屿 编辑
摘要:#include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=0x3f3f3f3f; int p[50]; struct edge{ int a,b,w; }e[100]; bool 阅读全文
posted @ 2020-01-29 11:09 晴屿 编辑
摘要://稀疏图 #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 510, INF = 0x3f3f3f3f; int n, m; int g[N][N]; int 阅读全文
posted @ 2019-11-13 01:38 晴屿 编辑
摘要://稠密图 #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 100010, M = 200010, INF = 0x3f3f3f3f; int n, m; i 阅读全文
posted @ 2019-11-13 01:38 晴屿 编辑

1
点击右上角即可分享
微信分享提示