有向图相关
爱上键盘的小哥哥
这个作者很懒,什么都没留下…
展开
-
迷宫城堡 HDU - 1269 (tarjan)
为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。Gardon需要请你写个程序确认一下是否任意两个房间都是相互连通的,即:对于任意的i和j,至少存在一条路径可以从房间i到房间...原创 2018-02-13 12:33:00 · 213 阅读 · 0 评论 -
The war HDU - 4005 (双联通分量+缩点)
In the war, the intelligence about the enemy is very important. Now, our troop has mastered the situation of the enemy's war zones, and known that these war zones can communicate to each other directl...原创 2018-07-19 14:09:24 · 291 阅读 · 0 评论 -
Network of Schools POJ - 1236 (tarjan)
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-07-17 21:24:00 · 167 阅读 · 0 评论 -
图的割点、桥和双连通分支的基本概念
点连通度与边连通度在一个无向连通图中,如果有一个顶点集合,删除这个顶点集合,以及这个集合中所有顶点相关联的边以后,原图变成多个连通块,就称这个点集为割点集合。一个图的点连通度的定义为,最小割点集合中的顶点数。 类似的,如果有一个边集合,删除这个边集合以后,原图变成多个连通块,就称这个点集为割边集合。一个图的边连通度的定义为,最小割边集合中的边数。双连通图、割点与桥如果一个无向连通图的点转载 2017-12-07 14:16:04 · 985 阅读 · 0 评论 -
Summer Holiday (tarjan缩点)
To see a World in a Grain of Sand And a Heaven in a Wild Flower, Hold Infinity in the palm of your hand And Eternity in an hour. —— William Blake 听说lcy帮大家预定了新马泰7日游,Wiskey真是高兴的...原创 2018-05-15 19:23:40 · 135 阅读 · 0 评论 -
Distance Queries POJ - 1986(最近公共祖先)
Farmer John's cows refused to run in his marathon since he chose a path much too long for their leisurely lifestyle. He therefore wants to find a path of a more reasonable length. The inp...原创 2018-05-21 18:49:10 · 225 阅读 · 0 评论 -
How far away ? HDU - 2586(最近公共祖先)
There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want to go from house A to house B"? Usually it hard ...原创 2018-05-20 10:10:32 · 555 阅读 · 0 评论 -
Railway HDU - 3394(tarjan)
There are some locations in a park, and some of them are connected by roads. The park manger needs to build some railways along the roads, and he would like to arrange tourist routes to each circuit...原创 2018-05-19 11:20:04 · 267 阅读 · 0 评论 -
Hawk-and-Chicken HDU - 3639(强联通缩点)
Kids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want to play the role of Hawk. So the teacher came up with an idea: ...原创 2018-05-19 09:41:55 · 272 阅读 · 0 评论 -
The King’s Problem HDU - 3861(tarjan缩点+最小路径覆盖)
In the Kingdom of Silence, the king has a new problem. There are N cities in the kingdom and there are M directional roads between the cities. That means that if there is a road from u to v, you can...原创 2018-05-17 21:13:04 · 319 阅读 · 0 评论 -
Network POJ - 1144
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...原创 2018-02-13 14:07:51 · 188 阅读 · 0 评论 -
B - Atm (tarjan缩点 + SPFA最长路)
Siruseri 城中的道路都是单向的。不同的道路由路口连接。按照法律的规定, 在每个路口都设立了一个 Siruseri 银行的 ATM 取款机。令人奇怪的是,Siruseri 的酒吧也都设在路口,虽然并不是每个路口都设有酒吧。Banditji 计划实施 Siruseri 有史以来最惊天动地的 ATM 抢劫。他将从市中心 出发,沿着单向道路行驶,抢劫所有他途径的 ATM 机,最终他将在...原创 2018-08-12 11:18:49 · 186 阅读 · 0 评论