摘要:
从1出发访问 5个给定点,最小化路程 枚举5个点的排列,然后单源最短路 #include <iostream> #include <cstring> #include <queue> using namespace std ; struct T{ int y,z; T(int y0,int z0){ 阅读全文
posted @ 2022-11-12 12:43
towboat
阅读(51)
评论(0)
推荐(0)
摘要:
求1到n的 次短路 #include <iostream> #include <cstring> #include <queue> using namespace std ; const int N=1e6+2,M=5e6+2; const int inf=0x3f3f3f3f; int all,n 阅读全文
posted @ 2022-11-12 10:56
towboat
阅读(21)
评论(0)
推荐(0)
摘要:
问1~n的最短路有几个 #include <iostream> #include <cstring> #include <queue> using namespace std ; const int N=1e6+2,M=2e6+2; const int inf=0x3f3f3f3f,mod=1000 阅读全文
posted @ 2022-11-12 10:21
towboat
阅读(58)
评论(0)
推荐(0)
摘要:
图上每个点有一头牛,现在牛群聚集到点X上聚会,然后又回到各自的点,而且牛只走最短路径 问所有最短路中最长的一条( 路径包含来回) 正反跑一次 spfa(X) , spfa(i) , ans=max{ d0[i]+ dis[X] } #include <iostream> #include <cstr 阅读全文
posted @ 2022-11-12 09:54
towboat
阅读(69)
评论(0)
推荐(0)
摘要:
在加权无向图上求出一条从 1 号结点到 N 号结点的路径,使路径上第 K + 1 大的边权尽量小 二分答案md, 判断1~n是否存在一条路径,花费不超过md 把w<=md 的边看作0,否则看作1,求1到n 的最短路,看 dis[n]<=md #include <bits/stdc++.h> usin 阅读全文
posted @ 2022-11-12 09:15
towboat
阅读(150)
评论(0)
推荐(0)
浙公网安备 33010602011771号