http://pipioj.online/problem.php?id=1484
思路:和这道题很像,暴力跑克鲁斯卡尔即可。想法就是,对边按照速度从小到大排序,从速度最小的边开始暴力枚举,那么当目标点 s 、 t s、t s、t连通时最大的边也确定了。复杂度大概在 O ( q m 2 ) O(qm^2) O(qm2),可过。
#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
const int maxm=2e3+5;
struct Edge
{
int u,v,s;
Edge