图
文章平均质量分 80
w-y-p
这个作者很懒,什么都没留下…
展开
-
poj-1270 Following Orders(拓扑排序)
Following OrdersTime Limit:1000MS Memory Limit:10000KB DescriptionOrder is an important concept in mathematics and in computer science. For example, Zorn's Lemma states: ``a partially orde原创 2014-08-03 20:14:56 · 616 阅读 · 0 评论 -
hihocoder 1185(tarjan缩点)
复习复习tarjan算法题目链接:hihocoder 1185#include#include#include#include #include#include#include#include#include#include#include#includeusing namespace std;#define maxn 20005#define maxm 100原创 2017-04-26 20:41:56 · 374 阅读 · 0 评论 -
hihocoder 1378(有向图求最小割集)
在最大流模板的基础上,求出最小割集题目链接:hihocoder 1378#include#include#include#include #include#include#include#include#include#include#include#includeusing namespace std;#define maxn 20005#define max原创 2017-04-28 11:25:50 · 3088 阅读 · 0 评论 -
hdu-4635(有向图缩点+判断强连通)
求在原有向图上最多可以添加多少边,使其仍满足不是强连通图思路:缩点后分成两部分,保证两部分不强连通(两部分之间,其中一部分的入度或出度应为0), 然后用sum(所有边)-tot(已有边)-两部分点数的乘积。/*求在原有向图上最多可以添加多少边,使其仍满足不是强连通图思路:缩点后分成两部分,保证两部分不强连通(两部分之间,其中一部分的入度或出度应为0),原创 2015-03-19 11:22:00 · 450 阅读 · 0 评论 -
hdu-3861(强连通图缩点+二分图最小路径覆盖)
题目大意:一个有向图,让你按规则划分区域,要求划分的区域数最少。规则如下:1、有边u到v以及有边v到u,则u,v必须划分到同一个区域内。2、一个区域内的两点至少要有一方能到达另一方。3、一个点只能划分到一个区域内。 解题思路:根据规则1可知必然要对强连通分量进行缩点,缩点后变成了一个弱连通图。根据规则2、3可知即是要求图的最小路径覆盖。定义:最小路径覆盖:在转载 2015-02-02 21:58:13 · 620 阅读 · 0 评论 -
poj-3692(最大完全子图)
KindergartenTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 5335 Accepted: 2602DescriptionIn a kindergarten, there are a lot of kids. All girls of the转载 2014-11-01 10:45:55 · 803 阅读 · 0 评论 -
Ural-1076 Trash(最小费用最大流算法)
TrashTime Limit:1000MS Memory Limit:16384KB DescriptionYou were just hired as CEO of the local junkyard.One of your jobs is dealing with the incoming trash and sorting it for recycling.Th原创 2014-08-11 16:46:19 · 775 阅读 · 0 评论 -
最小费用最大流模板
一、最小费用最大流的模型在保证流量最大的前提下,所需的费用最小,这就是最小费用最大流问题. 带有费用的网络流图: G=(V,E,C,W)V:顶点; E:弧;C:弧的容量;W:单位流量费用。任意的弧对应非负的容量c[i,j]和单位流量费用w[i,j]。满足:① 流量f是G的最大流。② 在f是G的最大流的前提下,流的费用最小。 F是G的最大流的集转载 2014-08-11 13:09:18 · 1061 阅读 · 0 评论 -
poj-1459 Power Network(网络最大流问题)
Power NetworkTime Limit:2000MS Memory Limit:32768KB DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u ma原创 2014-08-10 16:10:33 · 1262 阅读 · 0 评论 -
网络最大流poj1273,hdoj1532
最大流poj1273,hdoj1532看了几天关于最大流的书,今天找一道最经典的最大流题目hdoj1532,跟poj1273一样的题目,起初WA了,不知道什么原因。后来在POJ的discuss看到,原来是重边的问题,对该细节疏忽了。然后把代码改了一下,AC。这里用的是增广路算法——Edmons-Karp。算法思想是,从零流(所有边的流量均为0)开始不断增加流量,保持每次增加流量后都转载 2014-08-10 11:45:42 · 606 阅读 · 0 评论 -
Urall-1109(二分图的最大匹配 匈牙利算法)
ConferenceTime Limit:500MS Memory Limit:65536KB DescriptionOn the upcoming conference were sent M representatives of country A and N representatives of country B (M and N ≤ 1000). The re原创 2014-08-08 20:24:35 · 561 阅读 · 0 评论 -
UVA-10000 Longest Paths (SPFA最短路算法)
Longest PathsTime Limit:3000MS Memory Limit:0KB Description Longest Paths It is a well known fact that some people do not have their social abilities completely enabled. One example is t原创 2014-08-07 20:36:39 · 595 阅读 · 0 评论 -
poj-2240 Arbitrage(最佳路径 Floyd-Warshall算法)
ArbitrageTime Limit:1000MS Memory Limit:65536KB DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of原创 2014-08-06 15:49:52 · 605 阅读 · 0 评论 -
hdu-1385 Minimum Transport Cost(Dijkstra最短路径算法)
Minimum Transport CostTime Limit:2000MS Memory Limit:65536KBDescriptionThese are N cities in Spring country. Between each pair of cities there may be one transportation track or none. Now原创 2014-08-07 13:06:51 · 501 阅读 · 0 评论 -
poj-1258 Agri-Net(最小生成树 Prim算法)
Agri-NetTime Limit:1000MS Memory Limit:10000KB DescriptionFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the原创 2014-08-05 20:16:59 · 464 阅读 · 0 评论 -
poj-2253 Frogger(最佳路径 Warshall算法)
FroggerTime Limit:1000MS Memory Limit:65536KB DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans t原创 2014-08-06 12:55:14 · 490 阅读 · 0 评论 -
poj-2421 Constructing Roads(最小生成树 Kruskal算法)
Constructing RoadsTime Limit:2000MS Memory Limit:65536KB DescriptionThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can原创 2014-08-05 16:25:13 · 606 阅读 · 0 评论 -
hihocoder 1183(tarjan求缩点和桥)
题目链接:hihocoder 1183利用tarjan模板求无向图的割点和桥。#include#include#include#include #include#include#include#include#include#include#include#includeusing namespace std;#define maxn 20005#define原创 2017-04-27 12:02:35 · 464 阅读 · 0 评论