hdu 2680 Choose the best route

hdu 2680 Choose the best route

hdu 2680 Choose the best route

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include
#include 
#include 
#include 
#include 
using namespace std;
const int inf=1024;
const int N=1024;
int n,m,vis[N],edge[N][N],dist[N];

void Dijkstra(int v0)
{
    int i,j,k,u,minx;
    for(i=1; i<=n; i++)
    {
        dist[i]=edge[v0][i];
        vis[i]=0;
    }
    vis[v0]=1;
    dist[v0]=0;
    for(i=1; iw)
                edge[v][u]=w;
        }

        for(i=1; i<=n; i++)
            for(j=1; j<=n; j++)
            {
                if(i==j) edge[i][j]=0;
                else if(edge[i][j]==0) edge[i][j]=inf;
            }

        scanf("%d",&w);
        ans=inf;
        Dijkstra(s);

        for(i=0; i

http://www.bkjia.com/cjjc/1014558.htmlwww.bkjia.comtruehttp://www.bkjia.com/cjjc/1014558.htmlTechArticlehdu 2680 Choose the best route #include
#include #include #include #include #include #include #include
#include #include #美高梅59599,include #include #include using namespace
std;const int in…

admin

网站地图xml地图