
网络流
文章平均质量分 94
mumei314
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #674 (Div. 3)——ABCDE解题报告
Codeforces Round #674 (Div. 3)——ABCDE解题报告比赛链接:LinkA. Floor Number题解数据范围很小,直接模拟整个过程并且维护答案即可,当然也可以直接推出公式ans=n−2+x−1xans=\frac{n-2+x-1}{x}ans=xn−2+x−1。代码#include <bits/stdc++.h>#define PI atan(1.0)*4#define rp(i,s,t) for (register int i = (s);原创 2021-03-11 11:58:43 · 140 阅读 · 0 评论 -
初探强连通分量——习题,解析和资料
前一段时间学长拉了强连通的专题,当时有比赛没总结,最近几天有时间了,补一下前面的专题总结。强连通主要有两个算法,Kosaraju算法和Tarjan算法,其中最重要的就是Tarjan算法,不仅可以求强连通分量,还可以求连通分量,LCA,缩点,求割点和桥(割边)。不过这两个算法都是基于DFS的,其中Kosaraju算法更直接和简单一些,下面先讲一下Kosaraju算法,该算法主要是通过对原图取...原创 2019-08-02 10:52:35 · 322 阅读 · 0 评论 -
网络流入门——算法模板,习题和解析
最近一段时间再搞网络流,今天终于搞完了!!!!QAQ,好累呀。首先是关于网络流的基础知识,这部分东西有点多,就不在这里说了,给几个有用的资源。先推荐一下建图的博客:链式向前星,静态链表和邻接矩阵建图之后就是网络流入门的知识,可以看刘汝佳的紫书里面的知识和这几个博客网络流--最大流 数据结构与算法分析 - 网络流入门(Network Flow) 知道一些基础知识...原创 2019-07-30 13:29:05 · 471 阅读 · 0 评论 -
hdu3416——最短路+最大流
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3416Do not sincere non-interference。Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A...原创 2019-07-30 09:57:02 · 380 阅读 · 0 评论 -
hdu3081——最大流(二分图)+并查集(floyd)+二分
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3081Presumably, you all have known the question of stable marriage match. A girl will choose a boy; it is similar as the game of playing house we used ...原创 2019-07-30 09:46:19 · 176 阅读 · 0 评论 -
hdu3338——建图+最大流
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3338If you solved problem like this, forget it.Because you need to use a completely different algorithm to solve the following one.Kakuro puzzle is pl...原创 2019-07-30 09:23:10 · 280 阅读 · 0 评论 -
hdu2732——建图最大流+拆点
题目链接:https://cn.vjudge.net/problem/HDU-2732Your platoon of wandering lizards has entered a strange room in the labyrinth you are exploring. As you are looking around for hidden treasures, one of the...原创 2019-07-30 00:00:43 · 342 阅读 · 0 评论 -
UVA10480——最大流最小割(路径输出)板子题
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1421The regime of a small but wealthy dictatorship has been abruptly overthrown by an...原创 2019-07-29 22:47:39 · 246 阅读 · 0 评论 -
hdu4289——最大流最小割+拆点
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4289You, the head of Department of Security, recently received a top-secret information that a group of terrorists is planning to transport some WMD 1 ...原创 2019-07-29 22:30:36 · 181 阅读 · 0 评论 -
hdu4292——建模题(EK会超时)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4292You, 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 ...原创 2019-07-29 22:19:58 · 190 阅读 · 0 评论 -
hdu4280——最大流基础题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4280In 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 sh...原创 2019-07-29 22:08:56 · 394 阅读 · 0 评论 -
POJ1459——最大流模板题(EK,多方法)
题目链接:http://poj.org/problem?id=1459A power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >...原创 2019-07-29 21:58:34 · 485 阅读 · 0 评论 -
POJ2516——分治+最小费用最大流
题目链接:http://poj.org/problem?id=2516Dearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area there are N shopkeepers (marked from 1 to N) which stocks goods fr...原创 2019-07-29 18:24:01 · 192 阅读 · 0 评论 -
poj2195——最小费用最大流模板题
题目链接:http://poj.org/problem?id=2195On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to an adjacent p...原创 2019-07-29 17:34:46 · 273 阅读 · 0 评论 -
POJ1087——建图+建图+最大匹配(最大流)
题目链接:http://poj.org/problem?id=1087You are in charge of setting up the press room for the inaugural meeting of the United Nations Internet eXecutive (UNIX), which has an international mandate to mak...原创 2019-07-29 16:54:59 · 333 阅读 · 0 评论