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_20612820_8971.cpp:6:5: error: 'Q' does not name a type
     Q;    Q.clear();    memset(dist,-1,sizeof(dist));    Q.insert((L){ids,5});    dist[ids]=5;    set<L>::iterator  it;    while(!Q.empty()){        it=Q.begin();        now=*it;        Q.erase(it);         for(int i=0;i<n;i++){            if(br[now.x][i]==-1)continue;            int add=0,nowtime,tot,res;            nowtime=br[now.x][i]+dist[now.x];            tot=node[i].g+node[i].r+node[i].y;            res=nowtime%tot;            if(res>=node[i].g+node[i].y)add=5+tot-res;                   if(i==ide&&(ans==-1||ans>nowtime))ans=nowtime;             if(add+nowtime<dist[i]||dist[i]==-1){                dist[i]=nowtime+add;                Q.insert((L){i,dist[i]});               }        }    }}int main(){    while(scanf("%d%d%d%d",&n,&m,&ids,&ide)!=EOF&&(n||m||ids||ide)){        if(ids==ide){            printf("0:00\n");            continue;        }        for(int i=0;i<n;i++){            scanf("%d%d%d",&node[i].g,&node[i].y,&node[i].r);        }        memset(br,-1,sizeof(br));        for(int i=0;i<m;i++){            int  xx,yy,zz;            scanf("%d%d%d",&xx,&yy,&zz);            if(br[xx][yy]==-1||br[xx][yy]>zz)            br[xx][yy]=br[yy][xx]=zz;        }        ans=-1;        SPFA();        int second=ans;        int minute=second/60;        second=second%60;        printf("%d:%02d\n",minute,second);        }}
     ^
0_0_20612820_8971.cpp:6:11: error: 'Q' does not name a type
     Q;    Q.clear();    memset(dist,-1,sizeof(dist));    Q.insert((L){ids,5});    dist[ids]=5;    set<L>::iterator  it;    while(!Q.empty()){        it=Q.begin();        now=*it;        Q.erase(it);         for(int i=0;i<n;i++){            if(br[now.x][i]==-1)continue;            int add=0,nowtime,tot,res;            nowtime=br[now.x][i]+dist[now.x];            tot=node[i].g+node[i].r+node[i].y;            res=nowtime%tot;            if(res>=node[i].g+node[i].y)add=5+tot-res;                   if(i==ide&&(ans==-1||ans>nowtime))ans=nowtime;             if(add+nowtime<dist[i]||dist[i]==-1){                dist[i]=nowtime+add;                Q.insert((L){i,dist[i]});               }        }    }}int main(){    while(scanf("%d%d%d%d",&n,&m,&ids,&ide)!=EOF&&(n||m||ids||ide)){        if(ids==ide){            printf("0:00\n");            continue;        }        for(int i=0;i<n;i++){            scanf("%d%d%d",&node[i].g,&node[i].y,&node[i].r);        }        memset(br,-1,sizeof(br));        for(int i=0;i<m;i++){            int  xx,yy,zz;            scanf("%d%d%d",&xx,&yy,&zz);            if(br[xx][yy]==-1||br[xx][yy]>zz)            br[xx][yy]=br[yy][xx]=zz;        }        ans=-1;        SPFA();        int second=ans;        int minute=second/60;        second=second%60;        printf("%d:%02d\n",minute,second);        }}
           ^
0_0_20612820_8971.cpp:6:31: error: expected constructor, destructor, or type conversion before '(' token
     Q;    Q.clear();    memset(dist,-1,sizeof(dist));    Q.insert((L){ids,5});    dist[ids]=5;    set<L>::iterator  it;    while(!Q.empty()){        it=Q.begin();        now=*it;        Q.erase(it);         for(int i=0;i<n;i++){            if(br[now.x][i]==-1)continue;            int add=0,nowtime,tot,res;            nowtime=br[now.x][i]+dist[now.x];            tot=node[i].g+node[i].r+node[i].y;            res=nowtime%tot;            if(res>=node[i].g+node[i].y)add=5+tot-res;                   if(i==ide&&(ans==-1||ans>nowtime))ans=nowtime;             if(add+nowtime<dist[i]||dist[i]==-1){                dist[i]=nowtime+add;                Q.insert((L){i,dist[i]});               }        }    }}int main(){    while(scanf("%d%d%d%d",&n,&m,&ids,&ide)!=EOF&&(n||m||ids||ide)){        if(ids==ide){            printf("0:00\n");            continue;        }        for(int i=0;i<n;i++){            scanf("%d%d%d",&node[i].g,&node[i].y,&node[i].r);        }        memset(br,-1,sizeof(br));        for(int i=0;i<m;i++){            int  xx,yy,zz;            scanf("%d%d%d",&xx,&yy,&zz);            if(br[xx][yy]==-1||br[xx][yy]>zz)            br[xx][yy]=br[yy][xx]=zz;        }        ans=-1;        SPFA();        int second=ans;        int minute=second/60;        second=second%60;        printf("%d:%02d\n",minute,second);        }}
                               ^
0_0_20612820_8971.cpp:6:58: error: 'Q' does not name a type
     Q;    Q.clear();    memset(dist,-1,sizeof(dist));    Q.insert((L){ids,5});    dist[ids]=5;    set<L>::iterator  it;    while(!Q.empty()){        it=Q.begin();        now=*it;        Q.erase(it);         for(int i=0;i<n;i++){            if(br[now.x][i]==-1)continue;            int add=0,nowtime,tot,res;            nowtime=br[now.x][i]+dist[now.x];            tot=node[i].g+node[i].r+node[i].y;            res=nowtime%tot;            if(res>=node[i].g+node[i].y)add=5+tot-res;                   if(i==ide&&(ans==-1||ans>nowtime))ans=nowtime;             if(add+nowtime<dist[i]||dist[i]==-1){                dist[i]=nowtime+add;                Q.insert((L){i,dist[i]});               }        }    }}int main(){    while(scanf("%d%d%d%d",&n,&m,&ids,&ide)!=EOF&&(n||m||ids||ide)){        if(ids==ide){            printf("0:00\n");            continue;        }        for(int i=0;i<n;i++){            scanf("%d%d%d",&node[i].g,&node[i].y,&node[i].r);        }        memset(br,-1,sizeof(br));        for(int i=0;i<m;i++){            int  xx,yy,zz;            scanf("%d%d%d",&xx,&yy,&zz);            if(br[xx][yy]==-1||br[xx][yy]>zz)            br[xx][yy]=br[yy][xx]=zz;        }        ans=-1;        SPFA();        int second=ans;        int minute=second/60;        second=second%60;        printf("%d:%02d\n",minute,second);        }}
                                                          ^
0_0_20612820_8971.cpp:6:77: error: expected unqualified-id before ')' token
     Q;    Q.clear();    memset(dist,-1,sizeof(dist));    Q.insert((L){ids,5});    dist[ids]=5;    set<L>::iterator  it;    while(!Q.empty()){        it=Q.begin();        now=*it;        Q.erase(it);         for(int i=0;i<n;i++){            if(br[now.x][i]==-1)continue;            int add=0,nowtime,tot,res;            nowtime=br[now.x][i]+dist[now.x];            tot=node[i].g+node[i].r+node[i].y;            res=nowtime%tot;            if(res>=node[i].g+node[i].y)add=5+tot-res;                   if(i==ide&&(ans==-1||ans>nowtime))ans=nowtime;             if(add+nowtime<dist[i]||dist[i]==-1){                dist[i]=nowtime+add;                Q.insert((L){i,dist[i]});               }        }    }}int main(){    while(scanf("%d%d%d%d",&n,&m,&ids,&ide)!=EOF&&(n||m||ids||ide)){        if(ids==ide){            printf("0:00\n");            continue;        }        for(int i=0;i<n;i++){            scanf("%d%d%d",&node[i].g,&node[i].y,&node[i].r);        }        memset(br,-1,sizeof(br));        for(int i=0;i<m;i++){            int  xx,yy,zz;            scanf("%d%d%d",&xx,&yy,&zz);            if(br[xx][yy]==-1||br[xx][yy]>zz)            br[xx][yy]=br[yy][xx]=zz;        }        ans=-1;        SPFA();        int second=ans;        int minute=second/60;        second=second%60;        printf("%d:%02d\n",minute,second);        }}
                                                                             ^
0_0_20612820_8971.cpp:6:83: error: 'dist' does not name a type
     Q;    Q.clear();    memset(dist,-1,sizeof(dist));    Q.insert((L){ids,5});    dist[ids]=5;    set<L>::iterator  it;    while(!Q.empty()){        it=Q.begin();        now=*it;        Q.erase(it);         for(int i=0;i<n;i++){            if(br[now.x][i]==-1)continue;            int add=0,nowtime,tot,res;            nowtime=br[now.x][i]+dist[now.x];            tot=node[i].g+node[i].r+node[i].y;            res=nowtime%tot;            if(res>=node[i].g+node[i].y)add=5+tot-res;                   if(i==ide&&(ans==-1||ans>nowtime))ans=nowtime;             if(add+nowtime<dist[i]||dist[i]==-1){                dist[i]=nowtime+add;                Q.insert((L){i,dist[i]});               }        }    }}int main(){    while(scanf("%d%d%d%d",&n,&m,&ids,&ide)!=EOF&&(n||m||ids||ide)){        if(ids==ide){            printf("0:00\n");            continue;        }        for(int i=0;i<n;i++){            scanf("%d%d%d",&node[i].g,&node[i].y,&node[i].r);        }        memset(br,-1,sizeof(br));        for(int i=0;i<m;i++){            int  xx,yy,zz;            scanf("%d%d%d",&xx,&yy,&zz);            if(br[xx][yy]==-1||br[xx][yy]>zz)            br[xx][yy]=br[yy][xx]=zz;        }        ans=-1;        SPFA();        int second=ans;        int minute=second/60;        second=second%60;        printf("%d:%02d\n",minute,second);        }}
                                                                                   ^
0_0_20612820_8971.cpp:6:99: error: 'set' does not name a type
     Q;    Q.clear();    memset(dist,-1,sizeof(dist));    Q.insert((L){ids,5});    dist[ids]=5;    set<L>::iterator  it;    while(!Q.empty()){        it=Q.begin();        now=*it;        Q.erase(it);         for(int i=0;i<n;i++){            if(br[now.x][i]==-1)continue;            int add=0,nowtime,tot,res;            nowtime=br[now.x][i]+dist[now.x];            tot=node[i].g+node[i].r+node[i].y;            res=nowtime%tot;            if(res>=node[i].g+node[i].y)add=5+tot-res;                   if(i==ide&&(ans==-1||ans>nowtime))ans=nowtime;             if(add+nowtime<dist[i]||dist[i]==-1){                dist[i]=nowtime+add;                Q.insert((L){i,dist[i]});               }        }    }}int main(){    while(scanf("%d%d%d%d",&n,&m,&ids,&ide)!=EOF&&(n||m||ids||ide)){        if(ids==ide){            printf("0:00\n");            continue;        }        for(int i=0;i<n;i++){            scanf("%d%d%d",&node[i].g,&node[i].y,&node[i].r);        }        memset(br,-1,sizeof(br));        for(int i=0;i<m;i++){            int  xx,yy,zz;            scanf("%d%d%d",&xx,&yy,&zz);            if(br[xx][yy]==-1||br[xx][yy]>zz)            br[xx][yy]=br[yy][xx]=zz;        }        ans=-1;        SPFA();        int second=ans;        int minute=second/60;        second=second%60;        printf("%d:%02d\n",minute,second);        }}
               


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-27 00:43:36, Gzip enabled