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_29275346_9827.cpp:9:54: error: non-member function 'bool operator<(point, point)' cannot have ref-qualifier
 friend bool operator < (const point a,const point b)   { 
                                                      ^
0_0_29275346_9827.cpp:9:54: error: expected ';' at end of member declaration
0_0_29275346_9827.cpp:9:55: error: 'nbsp' does not name a type
 friend bool operator < (const point a,const point b)   { 
                                                       ^
0_0_29275346_9827.cpp:9:61: error: expected unqualified-id before '{' token
 friend bool operator < (const point a,const point b)   { 
                                                             ^
0_0_29275346_9827.cpp:11:1: error: expected ';' after struct definition
 }
 ^
0_0_29275346_9827.cpp: In function 'void bfs(point)':
0_0_29275346_9827.cpp:20:7: error: use of deleted function 'point::point()'
 point hd; 
       ^
0_0_29275346_9827.cpp:6:8: note: 'point::point()' is implicitly deleted because the default definition would be ill-formed:
 struct point{ 
        ^
0_0_29275346_9827.cpp:6:8: error: uninitialized reference member in 'struct point'
0_0_29275346_9827.cpp:8:9: note: 'int& point::nbsp' should be initialized
 int s;   
         ^
0_0_29275346_9827.cpp:21:22: error: 'nbsp' was not declared in this scope
 while(!Q.empty()) {   
                      ^
0_0_29275346_9827.cpp:22:3: error: use of deleted function 'point& point::operator=(const point&)'
 hd=Q.top();   
   ^
0_0_29275346_9827.cpp:6:8: note: 'point& point::operator=(const point&)' is implicitly deleted because the default definition would be ill-formed:
 struct point{ 
        ^
0_0_29275346_9827.cpp:6:8: error: non-static reference member 'int& point::nbsp', can't use default assignment operator
0_0_29275346_9827.cpp:25:8: error: return-statement with a value, in function returning 'void' [-fpermissive]
 return i;   }   for(i=0;i<8;i++)   {    int nx=hd.x+d[i][0];    int ny=hd.y+d[i][1];    if(nx<=0||ny<=0||nx>m||ny>n)      continue;      point t;      t.x=nx; t.y=ny; if(i!=a[hd.x][hd.y])      t.s=hd.s+1;      else      t.s=hd.s;      if(b[t.x][t.y]>t.s)        { b[t.x][t.y]=t.s;           Q.push(t);    }       } } return ; } int main() { int i,j,k,t; char s0; while(scanf("%d%d",&m,&n)!=EOF) { getchar(); for(i=1;i<=m;i++) {   for(j=1;j<=n;j++)   {    scanf("%c",&s0); a[i][j]=s0-'0';    }   getchar();     }     scanf("%d",&t);     while(t--)     {  scanf("%d%d%d%d",&x0,&y0,&x,&y);  if(x0==x&&y0==y)   {   printf("0\n");   continue;   }  for(i=1;i<=m;i++)   for(j=1;j<=n;j++)     b[i][j]=2222;  point v;  v.x=x0;  v.y=y0;  v.s=0;  b[x0][y0]=0;  bfs(v);  printf("%d\n",b[x][y]);     } } return 0;  } 
        ^
0_0_29275346_9827.cpp:25:219: error: use of deleted function 'point::point()'
 return i;   }   for(i=0;i<8;i++)   {    int nx=hd.x+d[i][0];    int ny=hd.y+d[i][1];    if(nx<=0||ny<=0||nx>m||ny>n)      continue;      point t;      t.x=nx; t.y=ny; if(i!=a[hd.x][hd.y])      t.s=hd.s+1;      else      t.s=hd.s;      if(b[t.x][t.y]>t.s)        { b[t.x][t.y]=t.s;           Q.push(t);    }       } } return ; } int main() { int i,j,k,t; char s0; while(scanf("%d%d",&m,&n)!=EOF) { getchar(); for(i=1;i<=m;i++) {   for(j=1;j<=n;j++)   {    scanf("%c",&s0); a[i][j]=s0-'0';    }   getchar();     }     scanf("%d",&t);     while(t--)     {  scanf("%d%d%d%d",&x0,&y0,&x,&y);  if(x0==x&&y0==y)   {   printf("0\n");   continue;   }  for(i=1;i<=m;i++)   for(j=1;j<=n;j++)     b[i][j]=2222;  point v;  v.x=x0;  v.y=y0;  v.s=0;  b[x0][y0]=0;  bfs(v);  printf("%d\n",b[x][y]);     } } return 0;  } 
                                                                                                                                                                                                                           ^
0_0_29275346_9827.cpp:25:331: error: 'else' without a previous 'if'
 return i;   }   for(i=0;i<8;i++)   {    int nx=hd.x+d[i][0];    int ny=hd.y+d[i][1];    if(nx<=0||ny<=0||nx>m||ny>n)      continue;      point t;      t.x=nx; t.y=ny; if(i!=a[hd.x][hd.y])      t.s=hd.s+1;      else      t.s=hd.s;      if(b[t.x][t.y]>t.s)        { b[t.x][t.y]=t.s;           Q.push(t);    }       } } return ; } int main() { int i,j,k,t; char s0; while(scanf("%d%d",&m,&n)!=EOF) { getchar(); for(i=1;i<=m;i++) {   for(j=1;j<=n;j++)   {    scanf("%c",&s0); a[i][j]=s0-'0';    }   getchar();     }     scanf("%d",&t);     while(t--)     {  scanf("%d%d%d%d",&x0,&y0,&x,&y);  if(x0==x&&y0==y)   {   printf("0\n");   continue;   }  for(i=1;i<=m;i++)   for(j=1;j<=n;j++)     b[i][j]=2222;  point v;  v.x=x0;  v.y=y0;  v.s=0;  b[x0][y0]=0;  bfs(v);  printf("%d\n",b[x][y]);     } } return 0;  } 
                                                                                                                                                                                                                                                                                                                                           ^
0_0_29275346_9827.cpp: In function 'int main()':
0_0_29275346_9827.cpp:25:650: error: 'nbsp' was not declared in this scope
 return i;   }   for(i=0;i<8;i++)   {    int nx=hd.x+d[i][0];    int ny=hd.y+d[i][1];    if(nx<=0||ny<=0||nx>m||ny>n)      continue;      point t;      t.x=nx; t.y=ny; if(i!=a[hd.x][hd.y])      t.s=hd.s+1;      else      t.s=hd.s;      if(b[t.x][t.y]>t.s)        { b[t.x][t.y]=t.s;           Q.push(t);    }       } } return ; } int main() { int i,j,k,t; char s0; while(scanf("%d%d",&m,&n)!=EOF) { getchar(); for(i=1;i<=m;i++) {   for(j=1;j<=n;j++)   {    scanf("%c",&s0); a[i][j]=s0-'0';    }   getchar();     }     scanf("%d",&t);     while(t--)     {  scanf("%d%d%d%d",&x0,&y0,&x,&y);  if(x0==x&&y0==y)   {   printf("0\n");   continue;   }  for(i=1;i<=m;i++)   for(j=1;j<=n;j++)     b[i][j]=2222;  point v;  v.x=x0;  v.y=y0;  v.s=0;  b[x0][y0]=0;  bfs(v);  printf("%d\n",b[x][y]);     } } return 0;  } 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^
0_0_29275346_9827.cpp:25:779: error: 'nbsp' was not declared in this scope
 return i;   }   for(i=0;i<8;i++)   {    int nx=hd.x+d[i][0];    int ny=hd.y+d[i][1];    if(nx<=0||ny<=0||nx>m||ny>n)      continue;      point t;      t.x=nx; t.y=ny; if(i!=a[hd.x][hd.y])      t.s=hd.s+1;      else      t.s=hd.s;      if(b[t.x][t.y]>t.s)        { b[t.x][t.y]=t.s;           Q.push(t);    }       } } return ; } int main() { int i,j,k,t; char s0; while(scanf("%d%d",&m,&n)!=EOF) { getchar(); for(i=1;i<=m;i++) {   for(j=1;j<=n;j++)   {    scanf("%c",&s0); a[i][j]=s0-'0';    }   getchar();     }     scanf("%d",&t);     while(t--)     {  scanf("%d%d%d%d",&x0,&y0,&x,&y);  if(x0==x&&y0==y)   {   printf("0\n");   continue;   }  for(i=1;i<=m;i++)   for(j=1;j<=n;j++)     b[i][j]=2222;  point v;  v.x=x0;  v.y=y0;  v.s=0;  b[x0][y0]=0;  bfs(v);  printf("%d\n",b[x][y]);     } } 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-06-23 10:24:19, Gzip enabled