![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
网络流
箱@子
这个作者很懒,什么都没留下…
展开
-
P3376 【模板】网络最大流 当前弧优化
#include<bits/stdc++.h>?#include<iostream>#include<cstring>#include<stack>#include<stdio.h>const int maxn = 1e4 + 10;int head[maxn];int dft[maxn];int cur[maxn];...原创 2019-09-18 11:05:35 · 94 阅读 · 0 评论 -
Drainage Ditches HDU - 1532 网络流模板
Drainage DitchesHDU - 1532Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite...原创 2019-09-18 11:30:46 · 100 阅读 · 0 评论 -
Flow Problem HDU - 3549 网络流水题
Network flow is a well-known difficult problem for ACMers. Given a graph, your task is to find out the maximum flow for the weighted directed graph.InputThe first line of input contains an integer...原创 2019-09-18 11:46:00 · 87 阅读 · 0 评论 -
洛谷p3381 最小费最大流模板 spfa + dinic
题目描述如题,给出一个网络图,以及其源点和汇点,每条边已知其最大流量和单位流量费用,求出其网络最大流和在最大流情况下的最小费用。输入格式第一行包含四个正整数N、M、S、T,分别表示点的个数、有向边的个数、源点序号、汇点序号。接下来M行每行包含四个正整数ui、vi、wi、fi,表示第i条有向边从ui出发,到达vi,边权为wi(即该边最大流量为wi),单位流量的费用为fi。输出格式...原创 2019-09-25 10:24:14 · 102 阅读 · 0 评论 -
ZOJ 2314 Reactor Cooling 无汇源有上下界可行流
vjudge挂了zoj链接:https://zoj.pintia.cn/problem-sets/91827364500/problems/91827365813Reactor CoolingTime Limit: 5000 msMemory Limit: 32768 KBThe terrorist group leaded by a well known internation...原创 2019-09-25 11:52:04 · 101 阅读 · 0 评论 -
洛谷P1251 餐巾计划问题 无汇源最小费用流
题目描述一个餐厅在相继的NN天里,每天需用的餐巾数不尽相同。假设第ii天需要r_iri块餐巾( i=1,2,...,N)。餐厅可以购买新的餐巾,每块餐巾的费用为pp分;或者把旧餐巾送到快洗部,洗一块需 m 天,其费用为 f 分;或者送到慢洗部,洗一块需nn天(n>mn>m),其费用为ss分(s<fs<f)。每天结束时,餐厅必须决定将多少块脏的...原创 2019-09-25 20:13:23 · 129 阅读 · 0 评论 -
P2754 [CTSC1999]家园 无汇源时间分层建图最大流
题目背景none!题目描述由于人类对自然资源的消耗,人们意识到大约在 2300 年之后,地球就不能再居住了。于是在月球上建立了新的绿地,以便在需要时移民。令人意想不到的是,2177 年冬由于未知的原因,地球环境发生了连锁崩溃,人类必须在最短的时间内迁往月球。现有 n 个太空站位于地球与月球之间,且有 m 艘公共交通太空船在其间来回穿梭。每个太空站可容纳无限多的人,而每艘太空船 i ...原创 2019-09-26 23:42:30 · 96 阅读 · 0 评论 -
Air Raid POJ - 1422 最小路径覆盖
Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an intersection and walking through town's streets you can...原创 2019-09-27 17:53:25 · 91 阅读 · 0 评论 -
POJ - 3041 Asteroids 最小点覆盖
Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are conveni...原创 2019-09-27 18:03:26 · 93 阅读 · 0 评论