当前位置: 首页 > news >正文

网站图片链接到视频怎么做西宁集团网站建设

网站图片链接到视频怎么做,西宁集团网站建设,软件网站排名,揭阳做网站最大流问题。ISAP算法。注意可能会有重边#xff0c;不过我用的数据结构支持重边。距离d我直接初始化为0#xff0c;也可以用BFS逆向找一次。-----------------------------------------------------------------------#includecstdio#includeiostream#inclu… 最大流问题。ISAP算法。注意可能会有重边不过我用的数据结构支持重边。距离d我直接初始化为0也可以用BFS逆向找一次。-----------------------------------------------------------------------#includecstdio#includeiostream#includealgorithm#includecstring#includevector#includequeue#define rep(i,l,r) for(int il;ir;i)#define dow(i,l,r) for(int il;ir;i--)#define clr(x,c) memset(x,c,sizeof(x))using namespace std;const int inf0x3f3f3f3f,maxn2005;struct edge {    int from,to,cap,flow;};struct ISAP {    int n,m,s,t;    vectoredge edges;    vectorint g[maxn];    int d[maxn];    int cur[maxn];    int p[maxn];    int num[maxn];    void init(int n) {        this-nn;        rep(i,0,n) g[i].clear();        edges.clear();    }    void addEdge(int from,int to,int cap) {        edges.push_back((edge){from,to,cap,0});        edges.push_back((edge){to,from,0,0});        medges.size();        g[from].push_back(m-2);        g[to].push_back(m-1);    }    int augment() {        int xt,ainf;        while(x!s) {            edge eedges[p[x]];            amin(a,e.cap-e.flow);            xedges[p[x]].from;        }        xt;        while(x!s) {            edges[p[x]].flowa;            edges[p[x]^1].flow-a;            xedges[p[x]].from;        }        return a;    }    int maxFlow(int s,int t) {        this-ss; this-tt;        int flow0;        clr(d,0);        clr(num,0);        rep(i,0,n) num[d[i]];        int xs;        clr(cur,0);        while(d[s]n) {            if(xt) {                flowaugment();                xs;            }            int ok0;            rep(i,cur[x],g[x].size()) {                edge eedges[g[x][i]];                if(e.cape.flow d[x]d[e.to]1) {                    ok1;                    p[e.to]g[x][i];                    cur[x]i;                    xe.to;                    break;                }            }            if(!ok) {                int mn-1;                rep(i,0,g[x].size()) {                    edge eedges[g[x][i]];                    if(e.cape.flow) mmin(m,d[e.to]);                }                if(--num[d[x]]0) break;                num[d[x]m1];                cur[x]0;                if(x!s) xedges[p[x]].from;            }        }        return flow;    }} isap;int s() {    int n,m;    cinmn;    isap.init(n);    rep(i,0,m) {        int from,to,cap,pd1;        scanf(%d%d%d,from,to,cap);        isap.addEdge(from-1,to-1,cap);    }    return isap.maxFlow(0,n-1);}int main() {    freopen(ditch.in,r,stdin);    freopen(ditch.out,w,stdout);    couts()endl;    return 0;}-----------------------------------------------------------------------  Drainage DitchesHal Burch Every time it rains on Farmer Johns fields, a pond forms over Bessies favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Thus, Farmer John has built a set of drainage ditches so that Bessies clover patch is never covered in water. Instead, the water is drained to a nearby stream. Being an ace engineer, Farmer John has also installed regulators at the beginning of each ditch, so he can control at what rate water flows into that ditch. Farmer John knows not only how many gallons of water each ditch can transport per minute but also the exact layout of the ditches, which feed out of the pond and into each other and stream in a potentially complex network. Note however, that there can be more than one ditch between two intersections. Given all this information, determine the maximum rate at which water can be transported out of the pond and into the stream. For any given ditch, water flows in only one direction, but there might be a way that water can flow in a circle. PROGRAM NAME: ditch INPUT FORMAT Line 1:Two space-separated integers, N (0 N 200) and M (2 M 200). N is the number of ditches that Farmer John has dug. M is the number of intersections points for those ditches. Intersection 1 is the pond. Intersection point M is the stream.Line 2..N1:Each of N lines contains three integers, Si, Ei, and Ci. Si and Ei (1 Si, Ei  M) designate the intersections between which this ditch flows. Water will flow through this ditch from Si to Ei. Ci (0 Ci  10,000,000) is the maximum rate at which water will flow through the ditch.SAMPLE INPUT (file ditch.in) 5 4 1 2 40 1 4 20 2 4 20 2 3 30 3 4 10OUTPUT FORMAT One line with a single integer, the maximum rate at which water may emptied from the pond. SAMPLE OUTPUT (file ditch.out) 50转载于:https://www.cnblogs.com/JSZX11556/p/4295472.html
http://www.zqtcl.cn/news/846333/

相关文章:

  • 西乡网站建设政务网站开发协议
  • 美食网站开发环境北京app网站建设
  • 郑州网站建设推广渠道重庆网站建设公司下载
  • 宜宾营销型网站建设网站建设需要什么资质
  • 重庆建网站有哪些学跨境电商要多少钱
  • 上海建设钢结构工程网站深圳电器公司排名
  • 淄博网站建设找淄深网江苏省建设斤网站
  • 免费行情软件app网站红色西安做网站印象网络
  • 宁波网站建设小程序开发聊城wap网站建设
  • 陇南网站网站建设泰安网站的建设
  • 哪个网站有介绍拿到家做的手工活建设银行网站怎么修改手机号码吗
  • 网站地图怎么用淘宝客推广网站建设
  • 外贸零售网站建设购物网站支付功能怎么做
  • 淘宝客如何做自己的网站西宁工程建设招聘信息网站
  • 天津都有哪些制作网站郑州官网首页
  • 个人网站开发模式海南省建设公司官网
  • edu网站开发做爰视频在线观看免费网站
  • 安防公司网站模板网站建设模板下载
  • 贵阳网站建设方案维护一 建设茶叶网站前的市场分析
  • 山东东营建设网官方网站百度电脑版
  • 做网站前途如何海尔网站建设推广
  • 投资公司网站建设万网域名安装wordpress
  • 高端网站建设企业官网建设wordpress相似推荐
  • php网站开发师招聘wordpress怎么换头像
  • 门禁考勤网站建设广西建设
  • 互助盘网站怎么做的织梦免费企业网站
  • 做羊毛毡的网站电子商务网站建设品牌
  • 用vue做商城网站常用的js教做发型的网站
  • 江西省寻乌县建设局网站广州网站建设一般多少钱
  • 做网站公司郑州郑州的网站建设公司哪家好网站开发word