图论
文章平均质量分 82
Pira
追求梦想的人,难免有些不切实际。。。
展开
-
poj 1470(LCA模板题)
Closest Common AncestorsTime Limit: 2000MS Memory Limit: 10000KTotal Submissions: 9221 Accepted: 2955Des原创 2011-09-14 14:02:12 · 1598 阅读 · 0 评论 -
SRMS 531 DIV1
第二题:Problem Statement Pinguos are funny little monsters. Actually, there exist N different types of Pinguos (for simplicity numbered from 1 to N). Each midnight, each Pinguo die原创 2012-02-09 16:02:33 · 659 阅读 · 0 评论 -
囧——线性规划与网络流24题之网络流入门经典
搞了好久终于搞定线性规划与网络流24题,不过机器人路径至今无解,第22题感觉是数据错了~~~我的代码,数据和题目题解是BYVoid那弄到的:http://download.csdn.net/source/3499468原创 2011-08-06 17:10:00 · 1511 阅读 · 0 评论 -
网络流题目集锦
橙色的链接表示A掉了,转向我的题解。。。转载自 分享最终编辑 acmcs最大流 POJ 1273 Drainage Ditches POJ 1274 The Perfect Stall (二分图匹配) POJ 1698 Alice's Chance POJ 1459 Power Network POJ 2112 Optimal Milki转载 2011-08-31 18:36:39 · 1081 阅读 · 0 评论 -
HIT 2715 Matrix3(最大费用最大流)
Matrix3My Tags (Edit) Source : bin3 Time limit : 5 sec Memory limit : 64 MSubmitted : 302, Accepted : 74Zhouguy原创 2012-05-02 14:44:53 · 991 阅读 · 0 评论 -
uva 820 - Internet Bandwidth(最大流入门题)
Internet Bandwidth On the Internet, machines (nodes) are richly interconnected, and many paths may exist between a given pair of nodes. The total message-carrying capacity (bandwidth) betw原创 2012-04-18 14:58:25 · 1418 阅读 · 0 评论 -
一些图论、网络流入门题总结、汇总
最短路问题此类问题类型不多,变形较少POJ 2449 Remmarguts' Date(中等)http://acm.pku.edu.cn/JudgeOnline/problem?id=2449题意:经典问题:K短路解法:dijkstra+A*(rec),方法很多相关:http://acm.pku.edu.cn/JudgeOnline/showcontest?cont转载 2011-08-31 18:37:33 · 1598 阅读 · 3 评论 -
uva 563 - Crimewave(分点+最大流)
Crimewave Nieuw Knollendam is a very modern town. This becomes clear already when looking at the layout of its map, which is just a rectangular grid of streets and avenues. Being an impo原创 2012-04-18 14:13:17 · 1040 阅读 · 2 评论 -
有向图强连通分量的Tarjan算法
本文转自BYvoid[有向图强连通分量]在有向图G中,如果两个顶点间至少存在一条路径,称两个顶点强连通(strongly connected)。如果有向图G的每两个顶点都强连通,称G是一个强连通图。非强连通图有向图的极大强连通子图,称为强连通分量(strongly connected components)。下图中,子图{1,2,3,4}为一个强连通分量,因为顶点1,2,3转载 2011-09-05 20:53:39 · 852 阅读 · 0 评论 -
poj 1556 The Doors(线段相交+最短路)
The DoorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4278 Accepted: 1759DescriptionYou are to find the length of the shortest path through a chamber原创 2012-08-04 20:18:45 · 686 阅读 · 0 评论 -
usaco 4.1 Fence Loops(floyd求最小环)
Fence LoopsThe fences that surround Farmer Brown's collection of pastures have gotten out of control. They are made up of straight segments from 1 through 200 feet long that join together only a原创 2012-07-22 20:36:16 · 940 阅读 · 1 评论 -
sgu 326 Perspective(最大流)
326. PerspectiveTime limit per test: 0.5 second(s)Memory limit: 65536 kilobytesinput: standardoutput: standardBreaking news! A Russian billionaire has bought a yet undisclosed NB原创 2012-01-14 18:55:16 · 1034 阅读 · 0 评论 -
WHU 1124 Football Coach(最大流)
Problem 1124 - Football CoachTime Limit: 2000MS Memory Limit: 65536KB Difficulty: 1 Total Submit: 82 Accepted: 46 Special Judge: NoDescriptionIt is not an easy job to be a coach原创 2012-01-14 15:11:56 · 1386 阅读 · 0 评论 -
poj 3728(LCA+并查集应用)
The merchantTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 1520 Accepted: 434Description原创 2011-09-14 21:40:37 · 1880 阅读 · 0 评论 -
poj 3417(LCA应用)
NetworkTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 2496 Accepted: 726DescriptionYixg原创 2011-09-15 11:24:08 · 1824 阅读 · 0 评论 -
zoj 3195(LCA应用)
Design the cityTime Limit: 1 Second Memory Limit: 32768 KBCerror is the mayor of city HangZhou. As you may know, the traffic sy原创 2011-09-15 16:26:19 · 992 阅读 · 0 评论 -
poj 3621
Sightseeing CowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4209 Accepted: 1384Description原创 2011-05-29 14:19:00 · 1134 阅读 · 0 评论 -
poj 2396(有上下界的可行流)
BudgetTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 3250 Accepted: 1227 Special JudgeDes原创 2011-08-28 19:22:44 · 974 阅读 · 0 评论 -
hust 1342 (有上下界的最小流)
Cheat SecretlyTime Limit: 1 Sec Memory Limit: 128 MBSubmissions: 269 Solved: 77DescriptionHH Big Cow(HBC) has taken part in an i原创 2011-08-28 14:01:57 · 1009 阅读 · 0 评论 -
hdu 3061Battle(最大流最小割的应用)
BattleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 398 Accepted Submission原创 2011-08-31 14:26:53 · 1173 阅读 · 0 评论 -
hdu 2883(最大流)
kebabTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 195 Accepted Submission(原创 2011-08-30 21:05:39 · 1151 阅读 · 0 评论 -
hdu 4067 Random Maze(最小费用最大流)
Random MazeTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 256 Accepted Subm原创 2011-10-08 16:05:41 · 2041 阅读 · 7 评论 -
poj 2391 Ombrophobic Bovines(floyd+二分+最大流)
Ombrophobic BovinesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8161 Accepted: 1861DescriptionFJ's cows really hate getting wet so much that the me原创 2012-01-13 15:22:02 · 1134 阅读 · 6 评论 -
usaco 4.2 The Perfect Stall(二分图最大匹配入门题)
The Perfect StallHal BurchFarmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all the stalls in the new原创 2012-07-24 20:11:21 · 745 阅读 · 0 评论 -
hdu 4322 Candy(最大费用流)2012 Multi-University Training Contest 3
CandyTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 164 Accepted Submission(s): 39Problem DescriptionThere are N candies and原创 2012-07-31 21:53:33 · 1100 阅读 · 0 评论 -
poj 2987 Firing(最大权闭合图)
FiringTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 6198 Accepted: 1875DescriptionYou’ve finally got mad at “the world’s most stupid” employees of原创 2012-09-24 20:06:30 · 1013 阅读 · 0 评论 -
usaco 5.3 Network of Schools(强连通分量+构造强连通最少边)
Network of SchoolsIOI '96 Day 1 Problem 3A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to whi原创 2012-09-25 15:16:37 · 1315 阅读 · 0 评论 -
usaco 5.4 Telecowmunication(最小割点集)
TelecowmunicationFarmer John's cows like to keep in touch via email so they have created a network of cowputers so that they can intercowmunicate. These machines route email so that if there exist原创 2012-09-25 20:51:46 · 1500 阅读 · 0 评论 -
07年冬令营 剪刀石头布(最小费用最大流)
剪刀石头布【问题描述】在一些一对一游戏的比赛(如下棋、乒乓球和羽毛球的单打)中,我们经常会遇到A胜过B,B胜过C而C又胜过A的有趣情况,不妨形象的称之为剪刀石头布情况。有的时候,无聊的人们会津津乐道于统计有多少这样的剪刀石头布情况发生,即有多少对无序三元组(A, B, C),满足其中的一个人在比赛中赢了另一个人,另一个人赢了第三个人而第三个人又胜过了第一个人。注意这里无序的意思是说三元组中原创 2012-10-18 18:52:20 · 1835 阅读 · 0 评论 -
srm 558 div1 1000 SurroundingGame(最小割构图题)
Problem Statement Surrounding Game is a single-player game played on a rectangular grid of cells. Cells are considered adjacent if they share a common side. (Hence, each cell has at most fou原创 2012-10-22 16:16:05 · 1464 阅读 · 2 评论 -
二分图
导读: 二分图指的是这样一种图:其所有的顶点分成两个集合M和N,其中M或N中任意两个在同一集合中的点都不相 连。二分图匹配是指求出一组边,其中的顶点分别在两个集合中,并且任意两条边都没有相同的顶点,这组边叫做二分图的匹配,而所能得到的最大的边的个数,叫 做最大匹配。计算二分图的算法有网络流算法和匈牙利算法(目前就知道这两种),其中匈牙利算法是比较巧妙的,具体过程如下(转自组合数学):令转载 2011-03-24 20:04:00 · 1021 阅读 · 0 评论 -
KM算法 二分图的最佳匹配
引用:KM算法是通过给每个顶点一个标号(叫做顶标)来把求最大权匹配的问题转化为求完备匹配的问题的。设顶点Xi的顶标为A[i],顶点Yi的顶标为B [i],顶点Xi与Yj之间的边权为w[i,j]。在算法执行过程中的任一时刻,对于任一条边(i,j),A[i]+B[j]>=w[i,j]始终 成立。KM算法的正确性基于以下定理: 若由二分图中所有满足A[i]+B[j]=w[i,j]的边(i,转载 2011-03-27 18:43:00 · 876 阅读 · 0 评论 -
ZOJ 3016 Cut(离散化+最小生成树)
地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3016题意:给你n条线段,这些线段都平行于坐标轴,没有线段重叠,但是有交点,切割每条线段有一个值,现在这些线段形成一些封闭的区间,问怎样切割使得所有点之间有通路,且花费最小分析:这题抛掉线段的外壳,很容易发现每个格子是一个点,外面的平面是一个点,点之间的边正好是原创 2013-07-14 09:34:52 · 2288 阅读 · 0 评论 -
poj 1149(最大流)
PIGSTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 10400 Accepted: 4540DescriptionMirko w原创 2011-09-01 20:59:05 · 873 阅读 · 0 评论 -
我的模板 最大流(Dinic & Isap)+最小费用最大流(SPFAFlow)==有更改
今天刻意用poj 3469 http://poj.org/problem?id=3469测了下模板,Isap并不像想象中那么快,难道是我写搓了,而且在网络流与线性规划中的最后一题,isap完败给Dinic了,我的Isap啊~~~不知道那些几百毫秒出解的是用什么算法。。。难道是。。。 dinic总体上挺不错的,递归版的Isap基本上与Dinic没差别,而非递归版在某些情况反而不如递归版,于是原创 2011-08-10 15:16:52 · 4586 阅读 · 7 评论 -
强连通分量与双连通分量
本文转自:http://blog.stqdd.com/?p=209对于有向连通图,如果任意两点之间都能到达,则称为强连通图。如果对于有向图的一个子图是强连通的,则称为强连通子图;极大的强连通子图称为强连通分量。一个有向图可以有多个强连通分量,一个点也算是强连通分量。强连通分量的术语是strongly connnected components,简称SCC 对于无转载 2011-09-08 17:51:56 · 1931 阅读 · 1 评论 -
usaco 4.4 Pollutant Control(最小割最少边数字典序最小)
Pollutant ControlHal BurchIt's your first day in Quality Control at Merry Milk Makers, and already there's been a catastrophe: a shipment of bad milk has been sent out. Unfortunately, you didn't d原创 2012-09-20 20:08:17 · 866 阅读 · 0 评论 -
poj 2449 Remmarguts' Date(K短路 Spfa+A*)
Remmarguts' DateTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 15717 Accepted: 4293Description"Good man never makes girls wait or breaks an appointment原创 2012-10-02 12:03:47 · 1604 阅读 · 0 评论 -
hdu 3062 Party(2-sat入门)
PartyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2165 Accepted Submission(s): 707Problem Description有n对夫妻被邀请参加一个聚会,因为场地的问原创 2012-10-02 19:27:17 · 861 阅读 · 0 评论 -
poj 3678 Katu Puzzle(2-sat应用)
Katu PuzzleTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5727 Accepted: 2067DescriptionKatu Puzzle is presented as a directed graph G(V, E) with each原创 2012-10-03 19:31:44 · 803 阅读 · 0 评论