最短路径算法
Seeyouer
这个作者很懒,什么都没留下…
展开
-
HDU- 2680 Choose the best route
HDU 2680 Choose the best route出处Problem Description One day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible原创 2017-10-13 20:12:01 · 269 阅读 · 0 评论 -
HDU 1863 畅通工程
省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input 测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( < 100 );随后的 N 行对应村庄间道路原创 2017-10-17 15:26:35 · 310 阅读 · 0 评论 -
mcpc2017—Faulty Robot
题意大意: 如图,红色边为强制边,起点为①,机器人在程序控制下每一步都会走强制边(若没有强制边则停下),但是这个程序有bug会使机器人可能会出错而不一定走强制边(机器人只会出错一次),问你机器人可能停下的地点有几个?思路: 把强制边权值设为0,非强制边权值为1,跑一遍bfs,找距离①小于等于1的即可(因为只会出错一次)注意: 一定要跑完bfs之后再判断距离!输入The fi...原创 2018-04-23 14:57:38 · 237 阅读 · 0 评论 -
UPC 6581 Fennec VS. Snuke
题目描述Fennec and Snuke are playing a board game. On the board, there are N cells numbered 1 through N, and N−1 roads, each connecting two cells. Cell ai is adjacent to Cell bi through the i-th road. ...原创 2018-07-31 20:59:09 · 202 阅读 · 0 评论