
图
julia7_
keep coding
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
A1013 Battle Over Cities (25 分)(删除图的一个节点需要添加几条边连通)(图的DFS)(邻接表存储)
It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we nee...原创 2019-02-25 19:43:37 · 319 阅读 · 0 评论 -
A1021 Deepest Root (25 分)(选出使整棵树高度最大的树根节点)(图的DFS)
A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root ...原创 2019-02-25 21:28:22 · 282 阅读 · 0 评论 -
A1034 Head of a Gang (30 分)(树的DFS)(邻接矩阵)(难)
One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call betweenAandB, we say thatAandBis related. The weight of a relation is defined to be t...原创 2019-02-26 12:54:25 · 269 阅读 · 0 评论 -
A1076 Forwards on Weibo (30 分)(L层之内的转发数)(图的BFS)
Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a ...原创 2019-02-26 14:02:57 · 184 阅读 · 0 评论 -
A1003 Emergency (25 分)(Dijsktra算法)(难)
As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the l...原创 2019-02-26 17:44:17 · 268 阅读 · 0 评论