图论
Polynomial Hierarchy
路漫漫其修远兮,吾将上下而求索。
展开
-
最短路
A - 温习最短路1 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些原创 2014-07-21 22:24:14 · 490 阅读 · 0 评论 -
(uva11671)差分约束问题总结
11671 - Sign of Matrix Time limit: 1.000 seconds 这个问题是个差分约束的问题,但是一开始看这个问题的时候没有发现是个差分约束的题,而且这个题我想了很长时间,在网上看的题解也没有看懂,甚是麻烦。 然后经过仔细思考才发现这个题是差分约束的苗头,根据这个题目的目的,是对行和列进行操作,每次对行或列进行加或减操作,题目的目的是使原创 2015-09-03 16:20:07 · 1212 阅读 · 1 评论 -
sap算法速推,dinic算法速推
sap算法,用求解k短路的思想,从后面进行bfs,(从前面也行,k短路不行),目的是获取距离标号,进行增广 时减少不必要的路径,直接获取最短的路径, ek算法bfs的目的是找到增光路,sap算法使用距离标号数组 目的是使增广路最短,仅此而已。原创 2015-08-26 16:22:53 · 453 阅读 · 0 评论 -
图论--坑纪实
记错本原创 2015-03-03 10:54:15 · 438 阅读 · 0 评论 -
又是奶牛。。。
J - Optimal Milking Time Limit:2000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64u Submit Status Description FJ has moved his K (1 <= K <= 30) milking machines out into原创 2014-08-17 12:58:20 · 470 阅读 · 0 评论 -
无源汇有上下界可行流存在定理
H - Reactor Cooling Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Description The terrorist group leaded by a well known international terroris原创 2014-08-10 11:11:36 · 1641 阅读 · 0 评论 -
网络流之最大流
G - Power Network Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description A power network consists of nodes (power stations, consumers原创 2014-08-08 16:12:05 · 433 阅读 · 0 评论 -
网络流EK算法
F - Flow Problem Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Network flow is a well-known difficult problem for ACMers. Given原创 2014-08-07 10:24:51 · 554 阅读 · 0 评论 -
凸包
[BestCoder Round #5]冠军的奖励是小米3手机一部 恭喜福州大学杨楠获得[BestCoder Round #4]冠军(iPad Mini一部) 《BestCoder用户手册》下载 Area of Mushroom Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K原创 2014-08-19 12:05:49 · 506 阅读 · 0 评论 -
MaxFLOW
E - Drainage Ditches Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Every time it rains on Farmer John's fields, a pond forms ov原创 2014-08-07 09:48:28 · 665 阅读 · 0 评论 -
强连通Tarjan算法入门
A - 迷宫城堡 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description 为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N Input 输入包含多组数据,输入的第一行原创 2014-07-31 15:42:49 · 562 阅读 · 0 评论 -
tarjan+缩点+强连通定理
C - Network of Schools Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status Description A number of schools are connected to a computer network.原创 2014-08-04 10:13:29 · 692 阅读 · 0 评论 -
tarjan+缩点
B - Popular Cows Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description Every cow's dream is to become the most popular cow in the her原创 2014-08-01 12:42:23 · 765 阅读 · 0 评论 -
Hdu1102
C - 最小生成树入门1 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description There are N villages, which are numbered from 1 to N, and you should b原创 2014-07-23 13:03:53 · 757 阅读 · 0 评论 -
MST
D - 最小生成树入门2 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到原创 2014-07-22 16:32:46 · 633 阅读 · 0 评论 -
(这是水题)pat-1013
1 2 1 3 1 2 3 Sample Output 1 0 0 dfs过,不用割点。。。。。好像有个三十分的,是顶级的得用割点,这个简单dfs过了。 代码: #include #include #include using namespace std; int mp[1010][1010]; int vis[1010]; int n; void dfs(int x){ fo原创 2015-10-24 20:13:26 · 394 阅读 · 0 评论