Currency Exchange-spfa 판단 루프

1167 단어 최단로

Currency Exchange


 POJ - 1860 
#include
#include
#include
using namespace std;
#define inf 0x3f3f3f3f
#define maxn 151
#define ll long long
ll n,m,s,a,b;
bool vis[maxn];
double v,dis[maxn];
double s1,s2,s3,s4;
double mmp[maxn][maxn];
double cost[maxn][maxn];
void spfa(int s)
{
    queueq;
    dis[s]=v;
    q.push(s);
    vis[s]=1;
    while(!q.empty())
    {
        int top=q.front();
        q.pop();
        vis[top]=0;
        for(int i=1; i<=n; i++)
        {
            if(dis[i]v)
                {
                    cout<>n>>m>>s>>v;
    for(int i=1; i<=n; i++)
        for(int j=1; j<=n; j++)
        {
            if(i==j)
                mmp[i][j]=1;
            else
                mmp[i][j]=0;
            cost[i][j]=0;
            vis[i]=0;
            dis[i]=0;
        }
    while(m--)
    {
        cin>>a>>b>>s1>>s2>>s3>>s4;
        mmp[a][b]=s1;
        mmp[b][a]=s3;
        cost[a][b]=s2;
        cost[b][a]=s4;
//        cout<

좋은 웹페이지 즐겨찾기