随笔分类 -  图论—————Dijkstra

摘要:*传送 题意: 给定$n$个点,求从$s$到$t$的最短路径,其中有两种走法(可以混搭):一种是走给定的m有向边($u_i$,$v_i$,$w_i$);另一种可以由任意点x到任意点y,其费用是$c$ $\times$ ($x$ $xor$ $y$) 朴素的建法是$O$ ($n^2$ $\times$ 阅读全文
posted @ 2020-04-19 18:39 小又又 阅读(192) 评论(1) 推荐(0)
摘要:*传送 给定平面上的n个点,定义$(x_1,y_1)$到$(x_2,y_2)$的费用为min(|$x_1$-$x_2$|,|$y_1$-$y_2$|),求从1号点走到n号点的最小费用。 先给一段证明:给定三个x值,$x_1<x_2<x_3$。可得$x_2-x_1<x_3-x_2<x_3-x_1$,对 阅读全文
posted @ 2020-02-17 21:56 小又又 阅读(125) 评论(0) 推荐(0)
摘要: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 h 阅读全文
posted @ 2020-01-17 20:00 小又又 阅读(275) 评论(0) 推荐(0)