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_35135359_18752.cpp: In function 'int Bfs()':
0_0_35135359_18752.cpp:27:5: error: reference to 'queue' is ambiguous
     queue q[maxn];int front=-1,rear=-1;
     ^
0_0_35135359_18752.cpp:13:8: note: candidates are: struct queue
 struct queue{int pre,d;};
        ^
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/queue:64:0,
                 from 0_0_35135359_18752.cpp:2:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_queue.h:96:11: note:                 template<class _Tp, class _Sequence> class std::queue
     class queue
           ^
0_0_35135359_18752.cpp:28:12: error: 'q' was not declared in this scope
     rear++;q[rear].pre=-1;q[rear].d=1;
            ^
0_0_35135359_18752.cpp:32:22: error: expected ')' before '{' token
         while(e!=NULL{            if(ylarmy.a[e->endpoint]==2){                ans+=g.vnode[e->endpoint].reble_army;                int d=q[front].d;                int pre=q[front].pre;                while(!ylarmy.b[d]){                    ans+=g.vnode[d].reble_army;                    g.vnode[d].reble_army=0;                    ylarmy.b[d]=true;                    d=q[pre].d;                    pre=q[pre].pre;                }                ylarmy.a[e->endpoint]=0;            }            if(ylarmy.a[e->endpoint]==0){                ylarmy.a[e->endpoint]=1;///表示已经走过的点                q[++rear].pre=front;                q[rear].d=e->endpoint;            }            e=e->nextEdg;        }    }    return ans;}int main(){    int n,k;    int i,p1,p2,d;    while(~scanf("%d%d",&n,&k)){        memset(ylarmy.a,0,sizeof(ylarmy.a));        memset(ylarmy.b,0,sizeof(ylarmy.b));        clearg(n);        for(i=1;i<=n;i++)            scanf("%d",&g.vnode[i].reble_army);        for(i=0;i<k;i++){            scanf("%d",&d);            ylarmy.a[d]=2;///表示友军        }        i=n-1;        while(i--){            scanf("%d%d",&p1,&p2);            insert(p1,p2);            insert(p2,p1);        }        printf("%d\n",Bfs());    }    return 0;}
                      ^
0_0_35135359_18752.cpp:32:567: error: expected '}' at end of input
         while(e!=NULL{            if(ylarmy.a[e->endpoint]==2){                ans+=g.vnode[e->endpoint].reble_army;                int d=q[front].d;                int pre=q[front].pre;                while(!ylarmy.b[d]){                    ans+=g.vnode[d].reble_army;                    g.vnode[d].reble_army=0;                    ylarmy.b[d]=true;                    d=q[pre].d;                    pre=q[pre].pre;                }                ylarmy.a[e->endpoint]=0;            }            if(ylarmy.a[e->endpoint]==0){                ylarmy.a[e->endpoint]=1;///表示已经走过的点                q[++rear].pre=front;                q[rear].d=e->endpoint;            }            e=e->nextEdg;        }    }    return ans;}int main(){    int n,k;    int i,p1,p2,d;    while(~scanf("%d%d",&n,&k)){        memset(ylarmy.a,0,sizeof(ylarmy.a));        memset(ylarmy.b,0,sizeof(ylarmy.b));        clearg(n);        for(i=1;i<=n;i++)            scanf("%d",&g.vnode[i].reble_army);        for(i=0;i<k;i++){            scanf("%d",&d);            ylarmy.a[d]=2;///表示友军        }        i=n-1;        while(i--){            scanf("%d%d",&p1,&p2);            insert(p1,p2);            insert(p2,p1);        }        printf("%d\n",Bfs());    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ^
0_0_35135359_18752.cpp:32:567: error: expected '}' at end of input
0_0_35135359_18752.cpp:32:567: error: expected '}' at end of input
0_0_35135359_18752.cpp:32:567: error: expected '}' at end of input


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-23 04:45:47, Gzip enabled