Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## G++过不了，C++就过了，这什么原因啊

Posted by letterwuyu at 2014-10-05 15:31:44 on Problem 2472
```#include<string.h>
#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<queue>
#define INF 0
#define N 20000+10
#define M 100+10
using namespace std;
typedef struct
{
int to;
double w;
int next;
}node;
node E[N];
int n,m;
double dis[M];
{
E[++cnt].to=b;
E[cnt].w=w;
}
double spfa(int s,int t)
{
for(int i=0;i<M;i++)
dis[i]=INF;
dis[s]=1;
int visit[M]={0};
queue<int>Q;
Q.push(s);
while(!Q.empty())
{
int k=Q.front();
Q.pop();
visit[k]=0;
{
int to=E[i].to;
double w=E[i].w;
if(dis[k]*w>dis[to])
{
dis[to]=dis[k]*w;
if(!visit[to])
{
visit[to]=1;
Q.push(to);
}
}
}
}
return dis[t];
}
int main()
{

int a,b;
double c;
while(~scanf("%d",&n))
{
if(n==0)
break;
cnt=1;
scanf("%d",&m);
for(int i=0;i<m;i++)
{
scanf("%d%d%lf",&a,&b,&c);
c=c/100;
}
double step=spfa(1,n);
printf("%.6lf percent\n",step*100);
}
return 0;
}

```

Followed by: