肝了2周的文化课,结果回来连通过编译都做不到了......
#include<iostream>
#include<vector>
using namespace std;
int n,m;
struct path
{
int v;
long double w;
};
vector<path>r[3005];
vector<path>r_now[3005];
int main()
{
scanf("%d%d",&n,&m);
for(int i=1;i<=m;i++)
{
int x,y;
long double z;
scanf("%d%d%Lf",&x,&y,&z);
r[x].push_back({y,z});
}
long double l=0,r=10000000000;
for(int i=1;i<=100;i++)
{
long double mid=(l+r)/2.0L;
for(int j=1;j<=n;j++)r_now[j].clear();
for(int j=1;j<=n;j++)
{
for(path p:r[j])
{
r_now[j].push_back({p.v,p.w-mid});
}
}
}
return 0;
}