![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
网络流最大流
龍木
若人生为棋,我愿为卒,漫漫征途,谁曾见我后退半步
展开
-
E - Island Transport
https://vjudge.net/contest/402729#problem/E In the vast waters far far away, there are many islands. People are living on the islands, and all the transport among the islands relies on the ships. You have a transportation company there. Some routes are原创 2020-10-21 17:58:02 · 114 阅读 · 0 评论 -
G - Control
https://vjudge.net/contest/402729#problem/G You, the head of Department of Security, recently received a top-secret information that a group of terrorists is planning to transport some WMD1from one city (the source) to another one (the destination). Y..原创 2020-10-21 14:17:15 · 193 阅读 · 0 评论 -
F - Food
https://vjudge.net/contest/402729#problem/F You, a part-time dining service worker in your college’s dining hall, are now confused with a new problem: serve as many people as possible. The issue comes up as people in your college are more and more diffi原创 2020-10-21 12:02:02 · 284 阅读 · 0 评论 -
B - Dining
https://vjudge.net/contest/402729#problem/B Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others. Farmer John has cooked fabulous meals for his cows, but he forgot to check his menu against原创 2020-10-21 10:42:25 · 111 阅读 · 0 评论 -
P1345 [USACO5.4]奶牛的电信Telecowmunication
链接:https://www.luogu.com.cn/problem/P1345 题目描述 农夫约翰的奶牛们喜欢通过电邮保持联系,于是她们建立了一个奶牛电脑网络,以便互相交流。这些机器用如下的方式发送电邮:如果存在一个由cc台电脑组成的序列a_1,a_2,\cdots ,a_ca1,a2,⋯,ac,且a_1a1与a_2a2相连,a_2a2与a_3a3相连,等等。那么电脑a_1a1和a_cac就可以互发电邮。 很不幸,有时候奶牛会不小心踩到电脑上,农夫约翰的...原创 2020-07-09 13:13:03 · 177 阅读 · 0 评论 -
地震逃生
链接:https://www.luogu.com.cn/problem/P1343 题目描述 汶川地震发生时,四川**中学正在上课,一看地震发生,老师们立刻带领x名学生逃跑,整个学校可以抽象地看成一个有向图,图中有n个点,m条边。1号点为教室,n号点为安全地带,每条边都只能容纳一定量的学生,超过楼就要倒塌,由于人数太多,校长决定让同学们分成几批逃生,只有第一批学生全部逃生完毕后,第二批学生才能从1号点出发逃生,现在请你帮校长算算,每批最多能运出多少个学生,x名学生分几批才能运完。 输入格式 第一行3原创 2020-07-08 15:11:08 · 215 阅读 · 0 评论 -
网络流最大流模板
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=200000+10,M=1e4+5,mod=1e9+7; ll n,m,s,t,h[N],cur[N],cnt=1,vis[N]; struct node{ ll to,nt,w; }e[N]; void add(ll u,ll v,ll w) { e[++cnt]={v,h[u],w}; h[u]=cnt; } .原创 2020-07-08 14:44:43 · 163 阅读 · 0 评论