上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 63 下一页
摘要: ```#include#include#include#includeusing namespace std;const int N = 1000+10;const int M = 500+10;int n,m;int map[N][M],vlink[M],link[M][N],max_cap;bool vis[M];int path(int s) { for(int i=0; i>1; //... 阅读全文
posted @ 2020-03-07 10:02 晴屿 阅读(81) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include #include using namespace std; #define N 510 int vis[N], match[N], maps[N][N], n, ans; void floyd() { for(int k=1; k<=n; k++) for(int i=1; i<=n; i++) for(int j=1; j<=n; j 阅读全文
posted @ 2020-03-06 21:33 晴屿 阅读(72) 评论(0) 推荐(0) 编辑
摘要: ```#include #include using namespace std;typedef long long int ll;const int maxn=101010;int e[maxn],ne[maxn],h[maxn],idx;int N, M;void add(int a,int b){ e[idx]=b; ne[idx]=h[a]; h[a]=idx++;}bool vis[ma... 阅读全文
posted @ 2020-03-06 21:28 晴屿 阅读(92) 评论(0) 推荐(0) 编辑
摘要: ```#include#include#include#includeusing namespace std;#define N 10100int vis[N], h[N], used[N], maps[1510][1510], n, ans;int e[N],ne[N],idx; void add(int a, int b){ e[idx]=b; ne[idx]=h[a]; h[a]=idx++... 阅读全文
posted @ 2020-03-06 21:17 晴屿 阅读(113) 评论(0) 推荐(0) 编辑
摘要: ```#include#include#include#include#includeconst int MAXN= 500000;//最大顶点数const int MAXM = 11000;//最大边数const int INF=0x3f3f3f3f;using namespace std;bool used[MAXN];int linker[MAXN],index[500][500];int ... 阅读全文
posted @ 2020-03-06 20:59 晴屿 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 匈牙利 阅读全文
posted @ 2020-03-05 22:04 晴屿 阅读(91) 评论(0) 推荐(0) 编辑
摘要: ```//HK算法模板题 #include #define inf 0x3f3f3f3fconst int maxn=3030;using namespace std;int e[maxn*maxn],ne[maxn*maxn],h[maxn*maxn],idx;struct node { double x,y,v;} a[maxn];int lx[maxn],ly[maxn],dx[maxn]... 阅读全文
posted @ 2020-03-05 21:27 晴屿 阅读(95) 评论(0) 推荐(0) 编辑
摘要: ```//把矩阵按行和列缩点,格子为1的就在所在行列加边//然后二分图求最大匹配,如果是n,代表可行,小于n就输出-1#include#includeusing namespace std;typedef long long ll;const int N=100+10;int g[N][N];int match[N];bool used[N];int n;bool find(int u) { fo... 阅读全文
posted @ 2020-03-05 21:02 晴屿 阅读(93) 评论(0) 推荐(0) 编辑
摘要: ```#include#include#include#includeusing namespace std;const int maxn = 1e4+5;int G[105][105];int a[maxn],b[maxn];int match[105];int st[105];int n,m,ans;bool find(int u) { for(int i = 1; i>n>>m>>k) { ... 阅读全文
posted @ 2020-03-04 17:31 晴屿 阅读(120) 评论(0) 推荐(0) 编辑
摘要: ```#include#include#includeusing namespace std;const int MAXN = 2e5;int match[MAXN], st[MAXN];int n,m,p;int e[MAXN],ne[MAXN],idx,h[MAXN];void add(int a,int b){ e[idx]=b; ne[idx]=h[a]; h[a]=idx++; }boo... 阅读全文
posted @ 2020-03-04 16:16 晴屿 阅读(88) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 63 下一页