LouZhang

导航

2012年8月12日

hdu_1269, 强连通分量的学习

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1269#include<cstdio>#include<cstring>const int maxn = 10000 + 10;struct Edge{ int to, next;}e[maxn*10];int head[maxn], index;int dfn[maxn], low[maxn];int belong[maxn], vis[maxn];int step, color;void add_edge(int u, int v){ e[index].to = v, e[inde 阅读全文

posted @ 2012-08-12 21:25 louzhang_swk 阅读(227) 评论(0) 推荐(0) 编辑

hdu_2063,二分图最大匹配的学习

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2063也拿这个当模板吧。。。#include<cstdio>#include<cstring>int k, m, n;bool g[510][510];int visit[510], link[510];bool dfs(int u){ for(int i = 1; i <= n; i ++){ if(g[u][i] && !visit[i]){ visit[i] = 1; if(link[i] == -1 || dfs(link[i])){ ... 阅读全文

posted @ 2012-08-12 16:34 louzhang_swk 阅读(155) 评论(0) 推荐(0) 编辑

poj_2516,最小费用最大流

摘要: http://poj.org/problem?id=2516参考这篇博客写的。。。http://www.cppblog.com/Icyflame/archive/2009/06/30/88941.html这几天算是被网络流整死了,算法太复杂了,理解起来确实是难。。2516#include<cstdio>#include<cstring>const int inf = 10000000;const int maxn = 110;struct Edge{ int u, v, w, c, next;}e[maxn * maxn * 4];int head[maxn], ind 阅读全文

posted @ 2012-08-12 14:00 louzhang_swk 阅读(212) 评论(0) 推荐(0) 编辑