2018年2月的全部文章
@kidultff

PAT-A 真题- 1072. Gas Station

原题干:A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must guarantee that all the houses are in its servic ...
  • 0
  • 0
@kidultff

Bellman-Ford算法求解带负权的最短路径问题

0x00、Dijkstra并不是万能的前面我们讲过了Dijkstra算法,Dijkstra算法可以很好的解决边权均为正数的最短路径问题,但是,请看下图:(上面的点是A,左边的是B,右边的是C,作图的时候忘记打上去了TAT...)如果我们使用Dijkstra来解决从A走向,我 ...
  • 0
  • 2
@kidultff

PAT-A 真题- 1018. Public Bike Management

原题干:There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to any other stations in the city.The Public Bike ...
  • 0
  • 1
@kidultff

PAT-A 真题- 1030. Travel Plan(DFS筛选最优路径法)

原题干和原解答在这里:https://www.mmuaa.com/post/4146348c786b1cf1.html下面这种方法显然比原来的解答复杂,而且耗费资源,但是是最不容易出错的一种方法,也是一个万能的解题模板,使用Dijkstra找出所有的最短路径,然后再由DFS遍历所有路径, ...
  • 0
  • 0
@kidultff

PAT-A 真题- 1030. Travel Plan

原题干:A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path between his/her starti ...
  • 0
  • 0