【LOJ3279】「JOISC 2020 Day3」迷路的猫

题目连接 点击打开连接html 题目解法 对于 A ≥ 3 A\geq 3 A≥3 的状况,考虑从 0 0 0 号点出发,求出到各个点的最短路 d i s t i dist_i disti​ 。 则对于一条边 ( x , y ) (x,y) (x,y) , ∣ d i s t x − d i s t y ∣ ≤ 1 |dist_x-dist_y|\leq 1 ∣distx​−disty​∣≤1 ,
相关文章
相关标签/搜索