
图论
yerkeys
小小程序猿
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ1258 Agri-Net 最小生成树Prim
Description Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course. Farmer John order...原创 2018-03-13 21:59:52 · 222 阅读 · 0 评论 -
POJ 2485 Highways Kruskal最小生成树
Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem...原创 2018-03-13 23:02:08 · 184 阅读 · 0 评论 -
POJ1797 Heavy Transportation Dijkstra算法
Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the ...原创 2018-03-07 15:07:28 · 255 阅读 · 0 评论 -
POJ1125 Stockbroker Grapevine 多源最短路径Floyd
http://poj.org/problem?id=1125 题意:股票经纪人要在一群人中散布传言,传言只能在认识的人中传递。给出经纪人的人数,每个经纪人和其他人关系的信息:编号和传递时间,求出以哪个人为起点可以在耗时最短的情况下让所有收到消息。 分析:多源最短路径问题,求出每个人传播消息给其他人的最短路径中的最大时间,从所有最大时间中找出最小值。 #include<iostr...原创 2018-03-11 16:41:53 · 371 阅读 · 0 评论 -
POJ1511 Invitation Cards SPFS最短路算法
http://poj.org/problem?id=1511 题意:给出n个点和m条有向边,问从1号点到各点和从这些点回来的总路程最小值。 先以1为源点进行spfs计算各点最短路径,再将所有边反向(可以直接建立两个图),再次以1为源点进行spfs计算最短路径,将所有路径长度相加。 //Memory: 24664KTime : 2016MS #include<iostream...原创 2018-03-08 18:00:06 · 223 阅读 · 0 评论