摘要: 思路:这个还是看的胡伯涛的论文《最小割在信息学竞赛中的应用》。是将最大密度子图问题转化为了01分数规划和最小割问题。直接上代码:#include #include #include #include #include #define Maxn 6010#define Maxm 200000#define LL double#define inf 100000000#define Abs(a) (a)>0?(a):(-a)using namespace std;struct Edge{ int from,to,next; LL val;}edge[Maxm];const double... 阅读全文
posted @ 2013-07-22 20:18 fangguo 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 思路:这题考的是最大闭权图。只要知道怎么求最大闭权图就知道怎么做。但好像有点卡模版,要高效的模版才行。#include #include #include #define Maxn 6010#define Maxm 200000#define LL __int64#define Abs(a) (a)>0?(a):(-a)using namespace std;struct Edge{ int from,to,next; LL val;}edge[Maxm];LL value[Maxn],inf=0;int index[Maxn],work[Maxn],dis[Maxn],q[Max... 阅读全文
posted @ 2013-07-22 12:14 fangguo 阅读(219) 评论(0) 推荐(0) 编辑