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;}
^
|