
图论
文章平均质量分 60
Twillz
这个作者很懒,什么都没留下…
展开
-
POJ 1679 The Unique MST(次小生成树)
The Unique MST Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 30841 Accepted: 11086 DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique原创 2017-07-21 10:44:18 · 231 阅读 · 0 评论 -
UVA 796 Critical Links(Tarjan求无向图中的桥)
桥:割边,即去掉之后原本连通的分支不再连通 求法:和割点差不多 只要 dfn[i]小于low[j],则ij就是割边 注意这题的输出格式,格式错误导致的wa了好几次,gg…..输出格式只要复制就可以了啊……. 还要按第一个输出点升序排序。。。。In a computer network a link L, which interconnects two servers, is consider原创 2017-09-19 08:36:30 · 453 阅读 · 0 评论 -
UVA 315 Network(Tarjan求无向图割点)
割点:删除该点和相关边,原来的连通图能变得不连通的点 求法: 当节点i是根(搜索起点)时,只要它的孩子多于两个,那么它就是割点,不用考虑形成环的情况,因为在遍历另一个形成环的点的孩子时,就已经从第一个形成环的孩子遍历到了它当节点i不是根的时候,它的孩子是j,当dfn[i]>=low[j]时,就是割点,因为当dfn[i]#include <iostream>#include <cstdio>#原创 2017-09-18 21:54:14 · 515 阅读 · 0 评论 -
HDU 1269 迷宫城堡(Tarjan or Kosaraju模板)
迷宫城堡Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 17917 Accepted Submission(s): 7852Problem Description 为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间原创 2017-09-18 15:16:17 · 589 阅读 · 0 评论 -
POJ 1236(强连通分量+Kosaraju)
Limit: 1000MS Memory Limit: 10000K Total Submissions: 19625 Accepted: 7732 DescriptionA number of schools are connected to a computer network. Agreements have been developed among those s原创 2017-09-18 11:23:58 · 643 阅读 · 0 评论 -
文章标题
Dining Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 19461 Accepted: 8670 DescriptionCows are such finicky eaters. Each cow has a preference for certain foods and drinks, an原创 2017-09-25 12:11:13 · 221 阅读 · 0 评论 -
God Father (树形dp 树的重心)
Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decided to arrest the mafia leaders.Unfortunately, the structure of原创 2017-07-27 15:58:17 · 351 阅读 · 0 评论 -
POJ 3613 Cow Relays k步最短路 (floyd + 矩阵快速幂)
Cow Relays Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7738 Accepted: 3033 DescriptionFor their physical fitness program, N (2 ≤ N ≤ 1,000,000) cows have decided to run a rel原创 2017-07-25 11:21:40 · 469 阅读 · 0 评论 -
次小生成树模板(坑惨了)
In order to prepare the “The First National ACM School Contest” (in 20??) the major of the city decided to provide all the schools with a reliable source of power. (The major is really afraid of blac原创 2017-07-23 18:52:06 · 388 阅读 · 0 评论 -
POJ 3249 (DAG)
Test for Job Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 11150 Accepted: 2630 DescriptionMr.Dog was fired by his company. In order to support his family, he must find a ne原创 2017-07-18 22:40:38 · 338 阅读 · 0 评论 -
HDU 4514 (无向图判断环及树的直径)
湫湫系列故事——设计风景线Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 5018 Accepted Submission(s): 932Problem Description 随着杭州西湖的知名度的进一步提升,园林规划专家湫原创 2017-07-18 21:23:06 · 875 阅读 · 0 评论 -
HDU 1142 最短路径的数量
A Walk Through the ForestTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8767 Accepted Submission(s): 3237Problem Description Jimmy experie原创 2017-07-18 11:52:27 · 721 阅读 · 0 评论 -
最短路——多关键字比较
给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。 (1Output输出 一行有两个数, 最短距原创 2017-07-17 22:30:06 · 344 阅读 · 0 评论 -
POJ 3159 Candies(最短路 差分约束)
Candies Time Limit: 1500MS Memory Limit: 131072K Total Submissions: 31848 Accepted: 8896 DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the原创 2017-07-17 21:37:15 · 317 阅读 · 0 评论 -
拓扑排序
有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input 输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;其中N表示队伍的个数,M表示接着有原创 2017-07-17 18:48:01 · 209 阅读 · 0 评论 -
图论题集
=============================以下是最小生成树+并查集====================================== 【HDU】 1213 How Many Tables 基础并查集★ 1272 小希的迷宫 基础并查集★ 1325&&poj1308 Is It A Tree?转载 2017-12-04 13:44:27 · 695 阅读 · 0 评论