F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_19221945_4849.cpp: In function 'void BFS(int)':
0_0_19221945_4849.cpp:22:69: error: 'd' was not declared in this scope
 int i,j;    pt now,next;    queue<pt> q;    now.x=x;    now.d=0;    d[now.x]=now.d;    q.push(now);    while(!q.empty())    {        now=q.front();        q.pop();        if (now.d>n+2) break;        for(i=1;i<=map[now.x][0];i++)        {            next.x=map[now.x][i];            next.d=now.d+1;            if (next.d<d[next.x])            {                d[next.x]=next.d;                q.push(next);                reach[x][next.x]=1;            }        }    }}
                                                                     ^
0_0_19221945_4849.cpp:22:182: error: 'n' was not declared in this scope
 int i,j;    pt now,next;    queue<pt> q;    now.x=x;    now.d=0;    d[now.x]=now.d;    q.push(now);    while(!q.empty())    {        now=q.front();        q.pop();        if (now.d>n+2) break;        for(i=1;i<=map[now.x][0];i++)        {            next.x=map[now.x][i];            next.d=now.d+1;            if (next.d<d[next.x])            {                d[next.x]=next.d;                q.push(next);                reach[x][next.x]=1;            }        }    }}
                                                                                                                                                                                      ^
0_0_19221945_4849.cpp:22:212: error: 'map' was not declared in this scope
 int i,j;    pt now,next;    queue<pt> q;    now.x=x;    now.d=0;    d[now.x]=now.d;    q.push(now);    while(!q.empty())    {        now=q.front();        q.pop();        if (now.d>n+2) break;        for(i=1;i<=map[now.x][0];i++)        {            next.x=map[now.x][i];            next.d=now.d+1;            if (next.d<d[next.x])            {                d[next.x]=next.d;                q.push(next);                reach[x][next.x]=1;            }        }    }}
                                                                                                                                                                                                                    ^
0_0_19221945_4849.cpp:22:423: error: 'reach' was not declared in this scope
 int i,j;    pt now,next;    queue<pt> q;    now.x=x;    now.d=0;    d[now.x]=now.d;    q.push(now);    while(!q.empty())    {        now=q.front();        q.pop();        if (now.d>n+2) break;        for(i=1;i<=map[now.x][0];i++)        {            next.x=map[now.x][i];            next.d=now.d+1;            if (next.d<d[next.x])            {                d[next.x]=next.d;                q.push(next);                reach[x][next.x]=1;            }        }    }}
                                                                                                                                                                                                                                                                                                                                                                                                                                       ^
0_0_19221945_4849.cpp: In function 'int main()':
0_0_19221945_4849.cpp:24:51: error: 'n' was not declared in this scope
 int m,k,i,x,y,z,j,sum;    while(scanf("%d %d %s",&n,&m,s)!=EOF)    {     memset(reach,0,sizeof(reach));     for(i=1;i<=n;i++)         reach[i][i]=1;     memset(map,0,sizeof(map));     for(i=1;i<=m;i++)     {         scanf("%d %d %d",&x,&y,&z);         x++;y++;         if (z>0) {reach[x][y]=1;map[x][++map[x][0]]=y;}     }     for(i=1;i<=n;i++)     {        for(j=1;j<=n;j++)         d[j]=0x1fffff;          BFS(i);     }     sum=0;     for(i=1;i<=n;i++)         for(j=1;j<=n;j++)             sum+=reach[i][j];     printf("%d\n",sum);    }    return 0;}
                                                   ^
0_0_19221945_4849.cpp:24:56: error: 's' was not declared in this scope
 int m,k,i,x,y,z,j,sum;    while(scanf("%d %d %s",&n,&m,s)!=EOF)    {     memset(reach,0,sizeof(reach));     for(i=1;i<=n;i++)         reach[i][i]=1;     memset(map,0,sizeof(map));     for(i=1;i<=m;i++)     {         scanf("%d %d %d",&x,&y,&z);         x++;y++;         if (z>0) {reach[x][y]=1;map[x][++map[x][0]]=y;}     }     for(i=1;i<=n;i++)     {        for(j=1;j<=n;j++)         d[j]=0x1fffff;          BFS(i);     }     sum=0;     for(i=1;i<=n;i++)         for(j=1;j<=n;j++)             sum+=reach[i][j];     printf("%d\n",sum);    }    return 0;}
                                                        ^
0_0_19221945_4849.cpp:24:81: error: 'reach' was not declared in this scope
 int m,k,i,x,y,z,j,sum;    while(scanf("%d %d %s",&n,&m,s)!=EOF)    {     memset(reach,0,sizeof(reach));     for(i=1;i<=n;i++)         reach[i][i]=1;     memset(map,0,sizeof(map));     for(i=1;i<=m;i++)     {         scanf("%d %d %d",&x,&y,&z);         x++;y++;         if (z>0) {reach[x][y]=1;map[x][++map[x][0]]=y;}     }     for(i=1;i<=n;i++)     {        for(j=1;j<=n;j++)         d[j]=0x1fffff;          BFS(i);     }     sum=0;     for(i=1;i<=n;i++)         for(j=1;j<=n;j++)             sum+=reach[i][j];     printf("%d\n",sum);    }    return 0;}
                                                                                 ^
0_0_19221945_4849.cpp:24:161: error: 'map' was not declared in this scope
 int m,k,i,x,y,z,j,sum;    while(scanf("%d %d %s",&n,&m,s)!=EOF)    {     memset(reach,0,sizeof(reach));     for(i=1;i<=n;i++)         reach[i][i]=1;     memset(map,0,sizeof(map));     for(i=1;i<=m;i++)     {         scanf("%d %d %d",&x,&y,&z);         x++;y++;         if (z>0) {reach[x][y]=1;map[x][++map[x][0]]=y;}     }     for(i=1;i<=n;i++)     {        for(j=1;j<=n;j++)         d[j]=0x1fffff;          BFS(i);     }     sum=0;     for(i=1;i<=n;i++)         for(j=1;j<=n;j++)             sum+=reach[i][j];     printf("%d\n",sum);    }    return 0;}
                                                                                                                                                                 ^
0_0_19221945_4849.cpp:24:385: error: 'd' was not declared in this scope
 int m,k,i,x,y,z,j,sum;    while(scanf("%d %d %s",&n,&m,s)!=EOF)    {     memset(reach,0,sizeof(reach));     for(i=1;i<=n;i++)         reach[i][i]=1;     memset(map,0,sizeof(map));     for(i=1;i<=m;i++)     {         scanf("%d %d %d",&x,&y,&z);         x++;y++;         if (z>0) {reach[x][y]=1;map[x][++map[x][0]]=y;}     }     for(i=1;i<=n;i++)     {        for(j=1;j<=n;j++)         d[j]=0x1fffff;          BFS(i);     }     sum=0;     for(i=1;i<=n;i++)         for(j=1;j<=n;j++)             sum+=reach[i][j];     printf("%d\n",sum);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                 ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-16 21:25:57, Gzip enabled