上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 59 下一页
摘要: /*先走一遍dfs找到每个点到他的子节点的位置,回溯的时候找到最大值和次大值再用一个dfs来更新值,先看是否是u最长路上的点,如果是的话用最大值+权值更新最大值和次大值,否则的话用次大值+权值更新最大值和次大值*/#include#include#define N 11000struct node... 阅读全文
posted @ 2014-07-23 18:59 HYDhyd 阅读(133) 评论(0) 推荐(0) 编辑
摘要: #pragma comment(linker,"/STACK:102400000,102400000")//总是爆栈加上这个就么么哒了#include#include#includeusing namespace std;#define N 210000#define inf 99999999str... 阅读全文
posted @ 2014-07-22 11:16 HYDhyd 阅读(158) 评论(0) 推荐(0) 编辑
摘要: /*以核心1为源点,以核心2为汇点建图,跑一遍最大流*/#include#include#includeusing namespace std;#define N 21000#define inf 999999999struct node {int u,v,w,next;}bian[N*40];in... 阅读全文
posted @ 2014-07-22 09:47 HYDhyd 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 我用临接表模拟容器超时#include#include#includeusing namespace std;#define N 110000vectorq[N];int f[N];int main() { int t,n,m,i,j,k,a,b; scanf("%d",&t); whi... 阅读全文
posted @ 2014-07-21 19:36 HYDhyd 阅读(122) 评论(0) 推荐(0) 编辑
摘要: /*一组测试实例4 4 23 12 4*/#include#include#includeusing namespace std;#define N 31000struct node {int u,v,next;}bian[N*10];int head[N],yong,indegree[N],n,f... 阅读全文
posted @ 2014-07-21 17:18 HYDhyd 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 几个比较好的博客http://www.renfei.org/blog/isap.htmlhttp://kenby.iteye.com/blog/945454http://blog.csdn.net/mypsq/article/details/37959249#include#include#incl... 阅读全文
posted @ 2014-07-21 16:58 HYDhyd 阅读(211) 评论(0) 推荐(0) 编辑
摘要: http://www.renfei.org/blog/isap.html算法与数学网络流-最大流问题 ISAP 算法解释2013-08-07Renfei Song 2 条评论内容提要 [隐藏]1 约定2 引入3 算法解释4 实现ISAP 是图论求最大流的算法之一,它很好的平衡了运行时间和程序复杂度... 阅读全文
posted @ 2014-07-20 17:14 HYDhyd 阅读(549) 评论(0) 推荐(0) 编辑
摘要: #include#include#define N 1100struct node {int u,v,next;}bian[N*N*2];int head[N],dfn[N],low[N],index,cut[N],yong,visit[N],dd[N],len,vis[N];void init(... 阅读全文
posted @ 2014-07-20 16:10 HYDhyd 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #include#include#define N 11000/*去掉一个割点后,询问可以分得的联通图的个数*/struct node {int u,v,next;}bian[N*100];/*cut数组记录去掉某个节点后可以增加的联通分支的个数,num数组记录以i为根节点的联通图的元素的个数*/... 阅读全文
posted @ 2014-07-20 14:43 HYDhyd 阅读(133) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/lyy289065406/article/details/6756821http://www.cnblogs.com/wuyiqi/archive/2011/10/19/2217911.html#include "stdio.h"#include "stri... 阅读全文
posted @ 2014-07-20 12:02 HYDhyd 阅读(156) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 59 下一页