Reactor Cooling(无源汇有上下界网络流)
194. Reactor Cooling
memory limit per test: 65536 KB
output: standard
The cooling system of the reactor consists of the number of pipes that special cooling liquid flows by. Pipes are connected at special points, called nodes, each pipe has the starting node and the end point. The liquid must flow by the pipe from its start point to its end point and not in the opposite direction.
Let the nodes be numbered from 1 to N. The cooling system must be designed so that the liquid is circulating by the pipes and the amount of the liquid coming to each node (in the unit of time) is equal to the amount of liquid leaving the node. That is, if we designate the amount of liquid going by the pipe from i-th node to j-th as f ij, (put f ij = 0 if there is no pipe from node i to node j), for each i the following condition must hold:
sum(j=1..N, f ij) = sum(j=1..N, f ji)
Each pipe has some finite capacity, therefore for each i and j connected by the pipe must be f ij ≤ c ij where c ij is the capacity of the pipe. To provide sufficient cooling, the amount of the liquid flowing by the pipe going from i-th to j-th nodes must be at least l ij, thus it must be f ij ≥ l ij.
Given c ij and l ij for all pipes, find the amount f ij, satisfying the conditions specified above.
4 6
1 2 1 2
2 3 1 2
3 4 1 2
4 1 1 2
1 3 1 2
4 2 1 2
Test #2
4 6
1 2 1 3
2 3 1 3
3 4 1 3
4 1 1 3
1 3 1 3
4 2 1 3
NO
Test #2
YES
1
2
3
2
1
1

然后跑一次最大流,判断是不是大于等于sum(即最小下界流量和),然后输出即可。
Reactor Cooling(无源汇有上下界网络流)的更多相关文章
- SGU 194. Reactor Cooling(无源汇有上下界的网络流)
时间限制:0.5s 空间限制:6M 题意: 显然就是求一个无源汇有上下界的网络流的可行流的问题 Solution: 没什么好说的,直接判定可行流,输出就好了 code /* 无汇源有上下界的网络流 * ...
- ZOJ 2314 (sgu 194) Reactor Cooling (无源汇有上下界最大流)
题意: 给定n个点和m条边, 每条边有流量上下限[b,c], 求是否存在一种流动方法使得每条边流量在范围内, 而且每个点的流入 = 流出 分析: 无源汇有上下界最大流模板, 记录每个点流的 in 和 ...
- ZOJ 2314 Reactor Cooling(无源汇有上下界可行流)
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2314 题目大意: 给n个点,及m根pipe,每根pipe用来流躺 ...
- SGU 194 Reactor Cooling 无源汇带上下界可行流
Reactor Cooling time limit per test: 0.5 sec. memory limit per test: 65536 KB input: standard output ...
- 【BZOJ3876】[AHOI2014&JSOI2014] 支线剧情(无源汇有上下界网络流)
点此看题面 大致题意: 有一张\(DAG\),经过每条边有一定时间,从\(1\)号点出发,随时可以返回\(1\)号点,求经过所有边的最短时间. 无源汇有上下界网络流 这是无源汇有上下界网络流的板子题. ...
- Zoj 2314 Reactor Cooling(无源汇有上下界可行流)
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1314 题意: 给n个点,及m根pipe,每根pipe用来流躺液体的,单向 ...
- [loj#115] 无源汇有上下界可行流 网络流
#115. 无源汇有上下界可行流 内存限制:256 MiB时间限制:1000 ms标准输入输出 题目类型:传统评测方式:Special Judge 上传者: 匿名 提交提交记录统计讨论测试数据 题 ...
- 【模板】无源汇有上下界可行流(网络流)/ZOJ2314
先导知识 网络最大流 题目链接 https://vjudge.net/problem/ZOJ-2314 题目大意 多组数据,第一行为数据组数 \(T\). 对于每一组数据,第一行为 \(n,m\) 表 ...
- 无源汇有上下界可行流(ZQU 1590)
无源汇有上下界可行流(也就是循环流) 模型:一个网络,求出一个流,使得每条边的流量必须>=Li且<=Hi, 每个点必须满足总流入量=总流出量(流量守恒)(这个流的特点是循环往复,无始无终) ...
随机推荐
- dubbo服务端响应超时错误一例记录
错误描述: Portlet J2AppsPortlet::QuickStartPortlet not available: Waiting server-side response timeout. ...
- 使用HttpClient携带pfx证书调用HTTPS协议的WebService
调用第三方服务时,厂商提供了一个WSDL文件.调用的地址和一个后缀为pfx的证书文件,通过SOUPUI记载证书是可以正常调用WebService服务,那么如何将该服务转换为代码呢? 咨询了厂商的支持, ...
- Matlab实现Butterworth滤波器 分类: 图像处理 2014-06-02 00:05 527人阅读 评论(0) 收藏
下面是用Matlab实现的Butterworth高通.低通滤波器. clc;clear all;close all; I=imread('cameraman.tif'); subplot(3,2,1) ...
- foreach的学习使用归纳
1: 实现对双向链表的遍历使用 LinkedList<string> llary = new LinkedList<string>(); llary.AddLast (&quo ...
- Linux oraenv Tips
Linux for the Oracle DBA -Customizing the Oracle User's Environment There are many ways to customize ...
- canvas 保存状态
1.保存和恢复绘图状态: 在绘制图形时,难免会重复使用某个样式,甚至有时会在不同颜色之间来回切换. 那么为了减少代码冗余,我们可以调用画布中的save()方法,来帮我们 保存一些样式和属性,这样我们就 ...
- java自动包装与解包
关于java的自动包装机制想必大家都用过吧,一般这些机制都用于在往容器中存储基本类型数据的时候,因为容器中不允许存在基本数据类型,所以就会调用自动包装机制,将基本数据类型转换为对象,将基本数据保存在对 ...
- Elasticsearch--集群管理_时光机&监控
目录 Elasticsearch时光机 创建快照存储库 清理:删除旧的快照 监控集群状态和健康度 集群健康度API 索引统计API 状态API 节点信息API 节点统计API 集群状态API 挂起任务 ...
- 关于docker入门教程
简介:docker入门教程 docker入门教程翻译自docker官方网站的Docker getting started 教程,官方网站:https://docs.docker.com/linux/s ...
- LigerUI用Post\Get\Ajax前后台交互方式的写法
parms 参数统一 json格式的数据 url 访问后台的url 设置同步参数 [javascript] view plain copy $.ajaxSetup({ async : false} ...