![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Tarjan
creator平
期望破茧成蝶时的飞翔,向往突破蝉蛹后的鸣叫。
展开
-
洛谷 P2341 [HAOI2006]受欢迎的牛|【模板】强连通分量
思路:求出度为0的点的联通数量,如果出度为0的点有一个以上,则为0 /* 洛谷 P2341 每头奶牛都梦想成为牛棚里的明星。被所有奶牛喜欢的奶牛就是一头明星奶牛。所有奶 牛都是自恋狂,每头奶牛总是喜欢自己的。奶牛之间的“喜欢”是可以传递的——如果A喜 欢B,B喜欢C,那么A也喜欢C。牛栏里共有N 头奶牛,给定一些奶牛之间的爱慕关系,请你 算出有多少头奶牛可以当明星。 第一行:两个用空格分开的整...原创 2019-10-17 16:30:54 · 138 阅读 · 0 评论 -
ZOJ 2588 Burning Bridges (求桥)
Ferry Kingdom is a nice little country located on N islands that are connected by M bridges. All bridges are very beautiful and are loved by everyone in the kingdom. Of course, the system of bridges i...原创 2018-11-29 08:28:13 · 120 阅读 · 0 评论 -
POJ 1523 SPF (求割点及子图个数)
Consider the two networks shown below. Assuming that data moves around these networks only between directly connected nodes on a peer-to-peer basis, a failure of a single node, 3, in the network on th...原创 2018-11-24 10:41:58 · 148 阅读 · 0 评论 -
HDU 4738 Caocao's Bridges (桥的权最小)
Caocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi. But he wouldn't give up. Caocao's army still was not good at water battles, so he came up with another idea. He built many island...原创 2018-11-16 13:44:21 · 152 阅读 · 0 评论 -
hdu 4685 Prince and Princess (二分图匹配+tarjan)
There are n princes and m princesses. Princess can marry any prince. But prince can only marry the princess they DO love. For all princes,give all the princesses that they love. So, there is a maximum...原创 2018-11-16 11:00:46 · 126 阅读 · 0 评论 -
HDU - 4635 Strongly connected
Give a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can add that the graph is still a simple directed graph. Also, after you add these edges, this...原创 2018-11-14 21:13:32 · 192 阅读 · 0 评论 -
hdu 4612 Warm up (tarjan+dfs)
N planets are connected by M bidirectional channels that allow instant transportation. It's always possible to travel between any two planets through these channels. If we can isolate some planets...原创 2018-11-14 17:22:49 · 172 阅读 · 0 评论 -
POJ - 1904 King's Quest (tarjan)
Once upon a time there lived a king and he had N sons. And there were N beautiful girls in the kingdom and the king knew about each of his sons which of those girls he did like. The sons of the king w...原创 2018-11-15 20:25:33 · 109 阅读 · 0 评论 -
POJ 3177 Redundant Paths (tarjan+缩点)
In order to get from one of the F (1 <= F <= 5,000) grazing fields (which are numbered 1..F) to another field, Bessie and the rest of the herd are forced to cross near the Tree of Rotten Apples....原创 2018-11-13 20:33:29 · 134 阅读 · 0 评论 -
POJ 1236——Network of Schools(强连通)
A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving sc...原创 2018-11-08 12:46:54 · 140 阅读 · 0 评论 -
POJ3694 Network (LCA+tarjan+并查集)
A network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly or indirectly by successive li...原创 2018-11-13 15:53:11 · 255 阅读 · 0 评论 -
UVA 796-Critical Links (求桥)
In a computer network a link L, which interconnects two servers, is considered critical if there are at least two servers A and B such that all network interconnection paths between A and B pass throu...原创 2018-11-10 11:35:14 · 214 阅读 · 0 评论 -
poj1144-Network (求割点)
A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N. No two places have the same number. The lines are bid...原创 2018-11-09 17:14:31 · 145 阅读 · 0 评论 -
HDU - 1269 ——迷宫城堡(强连通图的Tarjan算法)
为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。Gardon需要请你写个程序确认一下是否任意两个房间都是相互连通的,即:对于任意的i和j,至少存在一条路径可以从房间i到房间j,...原创 2018-04-23 19:57:02 · 140 阅读 · 0 评论