flow

git flow 备忘清单

你离开我真会死。 提交于 2019-11-27 07:16:01
git-flow 是一个 git 扩展集,在有git环境的基础上还需要下载git-flow扩展 安装扩展 Linux apt-get install git-flow macOS brew install git-flow-avh windows wget -q -O - --no-check-certificate https://raw.github.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh install stable | bash    原文链接: https://danielkummer.github.io/git-flow-cheatsheet/index.zh_CN.html 来源: https://www.cnblogs.com/yulongcode/p/11350320.html

网络流强化-HDU4280

旧巷老猫 提交于 2019-11-27 07:03:51
  数组没开够居然显示TLE而不是RE,自己觉得好的优化的方法没什么用……    //http://www.renfei.org/blog/isap.html 带解释的 //https://www.cnblogs.com/bosswnx/p/10353301.html 形式和我的比较相近的 #include<queue> #include<cstdio> #include<cstring> using namespace std; #define maxe 400096 //pay 双向边 一共10万条路 双向就是20万 反边就是40万 #define maxv 100005 //pay #define maxn 55 //pay #define sc scanf #define pt printf #define rep(i,a,b) for(int i=(a);i<(b);++i) const int inf = 0x3f3f3f3f; int cg,sp,ins; //cg change sp是总流量 ins是加速回溯点 int T,N,M ,s,t; int q[maxv],fro,rea; typedef struct ed{ int v,nxt,cap; //dis }ed; ed e[maxe]; int who_is_westernest,who_is

网络流总结

坚强是说给别人听的谎言 提交于 2019-11-27 03:21:30
洛谷 P2756 飞行员配对方案问题 分析 其实就是一个二分图匹配求最大匹配数的问题,加一个源点和汇点,再跑一遍网络流,输出方案的时候检查一下有没有流经过即可(反向边是否非0)。 注意: 每个点在向源点和汇点连边时,要在输入完之后再连。否则会重复连。 #include<bits/stdc++.h> using namespace std; #define N 205 #define M 30005 int to[M],head[N],nex[M],w[M],lev[N],tot=1,cnt=0,inf=0x7f7f7f,s=0,t=101,n,cur[N]; struct node{ int u,v,bian; }e[M]; queue<int> q; void add(int a,int b,int ww) { tot++; to[tot]=b; w[tot]=ww; nex[tot]=head[a]; head[a]=tot; if(ww==0&&b&&a!=t) e[cnt].bian=tot; } bool bfs() { memset(lev,-1,sizeof(lev)); lev[s]=0; q.push(s); while(!q.empty()) { int u=q.front(); q.pop(); for(int i=head[u];i!=-1;i=nex[i]

【网络流】——P1251 餐巾计划问题

元气小坏坏 提交于 2019-11-27 00:23:41
网络流的应用太多了,对于各种网络流的题目,要熟练运用建模思想,将实际问题转化为网络流模型。 GO: 洛谷 我们将问题划分成几个子问题:   1.“餐巾的数量”,“需要的费用”,“天数”分别指代什么?   2.快洗,慢洗会对哪些状态造成影响?   3.如何建立(记录)影响与影响间的关系   …… 首先,分析题意,不难发现这是一道最小费用最大流的问题。我们按贪心的思想看,每天分配好所需要的餐巾是基本任务,而让所花的费用最小是优化方案。 因此,分配餐巾对应着网络中的流,而费用就是费用。 快洗,慢洗等状态会为未来的某一天增加餐巾,因此影响的对象是未来洗完的那一天。 我们将一天分为两个状态:消耗餐巾和送出餐巾。 消耗餐巾,在网络流中即为消耗流(使用餐巾),而送出对应着增加花费(洗餐巾),这样就将模型初步建立完成了。 而对于程序本身而言,一个流为inf的边,代表可以随便走,最终这条边也不会被删去,但是只要走过了就会消耗费用,比如将今天的餐巾送出去洗。而一个流为0,费用为0的边,可以当做一个状态的转移,比如将今天的餐巾堆积到明天,既不消耗费用也不使用餐巾。所以限制好一些条件,让程序自己完成任务即可,这是网络流最大的魅力所在。 1 #include<bits/stdc++.h> 2 #define f(i,a,b) for(int i=a;i<=b;i++) 3 using namespace

【网络流】——最小费用最大流EK算法

一笑奈何 提交于 2019-11-27 00:04:12
本文非原创, 大 部分参考自 秋日私语 大大的题解。 GO: 模板    最大流问题,我们可以通过EK,DINIC等方法解决,但是如果在每条边上加上边权,并定义 费用 为边权乘以流量,在所有最大流中求出费用最少的那一个方案,就需要新的算法了。   这里只对最小费用最大流的EK-SPFA算法做一些自己的解释,并会附上模板。 首先是EK算法:   1.我们每次求一条源点到汇点的路径,流量最大为路径上的最小流量minflow,所以下一次寻找最大流就不能走那条,于是将所有边的流量减小minflow。   2.由1能保证求出最大流吗?答案是否定的,因为当我们遇到一些特殊的图时:    比如这个,第一条路径S-2-T,边上流量变为0,得到maxflow=4,实际上maxflow=6,因此我们要加一条反向边让路径有“反悔”的机会。   3.我们使用bfs进行增广,这样能保证在更少的次数下求出最大流。   4.对2具体的操作:记录路径上每个点的前驱和前驱边,走完spfa后从后向前遍历前驱边,修改流量。 最小费用最大流:    众所周知,SPFA他死了。   但这并不影响我们做网络流的题目(出题人没必要在网络流的题目上用图论卡我们),我们借鉴spfa的思想,对路径上求最短路。   具体看代码。 1 //EK-MCMF 2 #include<bits/stdc++.h> 3 using

How can I find the minimum cut on a graph using a maximum flow algorithm?

陌路散爱 提交于 2019-11-27 00:00:33
问题 I need to find the minimum cut on a graph. I've been reading about flow networks, but all I can find are maximum flow algorithms such as Ford-Fulkerson, push-relabel, etc. Given the max flow-min cut theorem, is it possible to use one of those algorithms to find the minimum cut on a graph using a maximum flow algorithm? How? The best information I have found so far is that if I find "saturated" edges i.e. edges where flow equals capacity, those edges correspond to the minimum cut. Is that true

最小费用最大流

旧城冷巷雨未停 提交于 2019-11-26 22:44:23
模板题 洛谷P3381 【模板】最小费用最大流 代码 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #define N 5005 #define M 100005 using namespace std; int n, m, s, t, tot = -1, max_flow = 0, min_cost = 0; int st[N], dis[N], cur[N], vis[N], pre[N], min_flow[N], q[N * 200]; struct node { int to, last, val, f/*flow*/; }w[M]; void add(int u, int v, int f, int ww) { w[++tot].to = v; w[tot].last = st[u]; w[tot].f = f; w[tot].val = ww; st[u] = tot; } bool spfa() { int l = 0, r = 1; q[r] = s; memset(dis, 0x3f, sizeof dis); memset(min_flow, 0x3f, sizeof min_flow); memset(cur, -1, sizeof cur); memset

学习:ITEXT导出doc

早过忘川 提交于 2019-11-26 21:58:33
首先我们需要的是itext.jar包。 itext是一个开源的rtf、pdf读写项目,属于sourceforge。rtf即是Rich Text Format,由微软公司开发的跨平台文档格式,缺点在于保存的大小会比较大,可能是由于考虑了兼容性的关系。 它的读写方式是比较通用的,无论是写rtf、pdf还是html,都有统一的Document,不同的格式有不同的写入器。如RTFWriter\PDFWriter。 下面记录几个概念: 1、 Font,字体对象 2、 Chunk,文本块,处理文本的最小单位,可以设置字体,颜色,等。 3、 Phrase,短语,由一个或多个Chunk组成。 4、 Paragraph,段落,由一个或多个Chunk以及Phrace组成。 5、 Chapter,章节对象 6、 Section,小节对象 7、 Table,表格对象 8、 Image,图像对象 备份一段代码: package com.anrainie.ide.flow.utilities.tool; import com.anrainie.ide.core.translators.StyleTranslator; import com.anrainie.ide.flow.utilities.document.MarsApplication; import com.anrainie.ide.flow

不再流 Flow-Less 60 Vegetarian Capsules

拟墨画扇 提交于 2019-11-26 21:34:54
Flow-Less contains a special combination of pumpkin seed extract and soy isoflavones that has been shown to support healthy bladder function. 帮助膀胱恢复正常功能,减少夜尿次数,缓解尿频尿急现象,从而促进安稳睡眠。男女皆宜。 Flow-Less 60 Vegetarian Capsules full product description Manufacturer: Allergy Research Group Product Code: ARG76310-60X Your Price: $22.90 ( $19.92 after 13% off) 转载于:https://www.cnblogs.com/shanghaijimzhou/archive/2013/03/15/2961244.html 来源: https://blog.csdn.net/weixin_30693183/article/details/99137937

HDU-3605-Escape(最大流, 状态压缩)

喜夏-厌秋 提交于 2019-11-26 21:26:40
链接: https://vjudge.net/problem/HDU-3605 题意: 2012 If this is the end of the world how to do? I do not know how. But now scientists have found that some stars, who can live, but some people do not fit to live some of the planet. Now scientists want your help, is to determine what all of people can live in these planets. 思路: 1e5个人,每个人都连边会T, 考虑每个人的状态,选10个星球,最多1024中选择,吧人转换程选择,压缩成1024中情况. 连到星球,在跑最大流即可. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <vector> //#include <memory.h> #include <queue> #include <set> #include <map> #include <algorithm> #include <math.h> #include