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_19224897_7496.cpp: In function 'int check(int, int)':
0_0_19224897_7496.cpp:17:98: error: 'times' was not declared in this scope
 int sumt=0;    for(set<node>::iterator it=line[x].begin(); it!=line[x].end(); ++it)        sumt+=times[it->x][t];    return sumt+times[x][t];}
                                                                                                  ^
0_0_19224897_7496.cpp:17:130: error: 'times' was not declared in this scope
 int sumt=0;    for(set<node>::iterator it=line[x].begin(); it!=line[x].end(); ++it)        sumt+=times[it->x][t];    return sumt+times[x][t];}
                                                                                                                                  ^
0_0_19224897_7496.cpp: In function 'int main()':
0_0_19224897_7496.cpp:20:54: error: 'dp' was not declared in this scope
 int maxx[2];        maxx[0]=maxx[1]=0;        memset(dp,-1,sizeof(dp));        memset(times,0,sizeof(times));        for(int i=0; i<=n; ++i) line[i].clear();         for(int i=0; i<m; ++i)        {            scanf("%d%d%d",&p,&q,&d);            temp.t=d;            temp.x=q;            line[p].insert(temp);            temp.x=p;            line[q].insert(temp);        }        for(;scanf("%d%d%d",&x,&a,&k);)        {            if(x+a+k==0)  break;            times[a][x]+=k;        }        for(int i=1; i<=n; ++i)            for(int j=1; j<=t; ++j)                alltime[i][j]=check(i,j);        for(int i=1; i<=n; ++i)        {            dp[1][i][0]=times[i][1];            dp[1][i][1]=alltime[i][1];        }        for(int i=1; i<=t; ++i)            for(int j=1; j<=n; ++j)            {                if(dp[i][j][0]!=-1)                {                    for(set<node>::iterator it=line[j].begin(); it!=line[j].end(); ++it)                    {                        if(i+it->t<=t)                        {                             dp[i+it->t][it->x][0]=max(dp[i+it->t][it->x][0],dp[i][j][0]+times[it->x][i+it->t]);                             dp[i+it->t][it->x][1]=max(dp[i+it->t][it->x][1],dp[i][j][0]+alltime[it->x][i+it->t]);                             dp[i+it->t][it->x][1]=max(dp[i+it->t][it->x][1],dp[i][j][1]+times[it->x][i+it->t]);                             maxx[0]=max(maxx[0],dp[i+it->t][it->x][0]);                            maxx[1]=max(maxx[1],dp[i+it->t][it->x][1]);                        }                    }                    if(i+1<=t)                    {                        dp[i+1][j][0]=max(dp[i+1][j][0],dp[i][j][0]+times[j][i+1]);                        dp[i+1][j][1]=max(dp[i+1][j][1],dp[i][j][0]+alltime[j][i+1]);                        dp[i+1][j][1]=max(dp[i+1][j][1],dp[i][j][1]+times[j][i+1]);                        maxx[0]=max(maxx[0],dp[i+1][j][0]);                        maxx[1]=max(maxx[1],dp[i+1][j][1]);                    }                }            }        printf("%d %d\n",maxx[1],maxx[0]);    }    return 0;}
                                                      ^
0_0_19224897_7496.cpp:20:87: error: 'times' was not declared in this scope
 int maxx[2];        maxx[0]=maxx[1]=0;        memset(dp,-1,sizeof(dp));        memset(times,0,sizeof(times));        for(int i=0; i<=n; ++i) line[i].clear();         for(int i=0; i<m; ++i)        {            scanf("%d%d%d",&p,&q,&d);            temp.t=d;            temp.x=q;            line[p].insert(temp);            temp.x=p;            line[q].insert(temp);        }        for(;scanf("%d%d%d",&x,&a,&k);)        {            if(x+a+k==0)  break;            times[a][x]+=k;        }        for(int i=1; i<=n; ++i)            for(int j=1; j<=t; ++j)                alltime[i][j]=check(i,j);        for(int i=1; i<=n; ++i)        {            dp[1][i][0]=times[i][1];            dp[1][i][1]=alltime[i][1];        }        for(int i=1; i<=t; ++i)            for(int j=1; j<=n; ++j)            {                if(dp[i][j][0]!=-1)                {                    for(set<node>::iterator it=line[j].begin(); it!=line[j].end(); ++it)                    {                        if(i+it->t<=t)                        {                             dp[i+it->t][it->x][0]=max(dp[i+it->t][it->x][0],dp[i][j][0]+times[it->x][i+it->t]);                             dp[i+it->t][it->x][1]=max(dp[i+it->t][it->x][1],dp[i][j][0]+alltime[it->x][i+it->t]);                             dp[i+it->t][it->x][1]=max(dp[i+it->t][it->x][1],dp[i][j][1]+times[it->x][i+it->t]);                             maxx[0]=max(maxx[0],dp[i+it->t][it->x][0]);                            maxx[1]=max(maxx[1],dp[i+it->t][it->x][1]);                        }                    }                    if(i+1<=t)                    {                        dp[i+1][j][0]=max(dp[i+1][j][0],dp[i][j][0]+times[j][i+1]);                        dp[i+1][j][1]=max(dp[i+1][j][1],dp[i][j][0]+alltime[j][i+1]);                        dp[i+1][j][1]=max(dp[i+1][j][1],dp[i][j][1]+times[j][i+1]);                        maxx[0]=max(maxx[0],dp[i+1][j][0]);                        maxx[1]=max(maxx[1],dp[i+1][j][1]);                    }                }            }        printf("%d %d\n",maxx[1],maxx[0]);    }    return 0;}
                                                                                       ^
0_0_19224897_7496.cpp:20:571: error: 'alltime' was not declared in this scope
 int maxx[2];        maxx[0]=maxx[1]=0;        memset(dp,-1,sizeof(dp));        memset(times,0,sizeof(times));        for(int i=0; i<=n; ++i) line[i].clear();         for(int i=0; i<m; ++i)        {            scanf("%d%d%d",&p,&q,&d);            temp.t=d;            temp.x=q;            line[p].insert(temp);            temp.x=p;            line[q].insert(temp);        }        for(;scanf("%d%d%d",&x,&a,&k);)        {            if(x+a+k==0)  break;            times[a][x]+=k;        }        for(int i=1; i<=n; ++i)            for(int j=1; j<=t; ++j)                alltime[i][j]=check(i,j);        for(int i=1; i<=n; ++i)        {            dp[1][i][0]=times[i][1];            dp[1][i][1]=alltime[i][1];        }        for(int i=1; i<=t; ++i)            for(int j=1; j<=n; ++j)            {                if(dp[i][j][0]!=-1)                {                    for(set<node>::iterator it=line[j].begin(); it!=line[j].end(); ++it)                    {                        if(i+it->t<=t)                        {                             dp[i+it->t][it->x][0]=max(dp[i+it->t][it->x][0],dp[i][j][0]+times[it->x][i+it->t]);                             dp[i+it->t][it->x][1]=max(dp[i+it->t][it->x][1],dp[i][j][0]+alltime[it->x][i+it->t]);                             dp[i+it->t][it->x][1]=max(dp[i+it->t][it->x][1],dp[i][j][1]+times[it->x][i+it->t]);                             maxx[0]=max(maxx[0],dp[i+it->t][it->x][0]);                            maxx[1]=max(maxx[1],dp[i+it->t][it->x][1]);                        }                    }                    if(i+1<=t)                    {                        dp[i+1][j][0]=max(dp[i+1][j][0],dp[i][j][0]+times[j][i+1]);                        dp[i+1][j][1]=max(dp[i+1][j][1],dp[i][j][0]+alltime[j][i+1]);                        dp[i+1][j][1]=max(dp[i+1][j][1],dp[i][j][1]+times[j][i+1]);                        maxx[0]=max(maxx[0],dp[i+1][j][0]);                        maxx[1]=max(maxx[1],dp[i+1][j][1]);                    }                }            }        printf("%d %d\n",maxx[1],maxx[0]);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
0_0_19224897_7496.cpp:20:696: error: 'alltime' was not declared in this scope
 int maxx[2];        maxx[0]=maxx[1]=0;        memset(dp,-1,sizeof(dp));        memset(times,0,sizeof(times));        for(int i=0; i<=n; ++i) line[i].clear();         for(int i=0; i<m; ++i)        {            scanf("%d%d%d",&p,&q,&d);            temp.t=d;            temp.x=q;            line[p].insert(temp);            temp.x=p;            line[q].insert(temp);        }        for(;scanf("%d%d%d",&x,&a,&k);)        {            if(x+a+k==0)  break;            times[a][x]+=k;        }        for(int i=1; i<=n; ++i)            for(int j=1; j<=t; ++j)                alltime[i][j]=check(i,j);        for(int i=1; i<=n; ++i)        {            dp[1][i][0]=times[i][1];            dp[1][i][1]=alltime[i][1];        }        for(int i=1; i<=t; ++i)            for(int j=1; j<=n; ++j)            {                if(dp[i][j][0]!=-1)                {                    for(set<node>::iterator it=line[j].begin(); it!=line[j].end(); ++it)                    {                        if(i+it->t<=t)                        {                             dp[i+it->t][it->x][0]=max(dp[i+it->t][it->x][0],dp[i][j][0]+times[it->x][i+it->t]);                             dp[i+it->t][it->x][1]=max(dp[i+it->t][it->x][1],dp[i][j][0]+alltime[it->x][i+it->t]);                             dp[i+it->t][it->x][1]=max(dp[i+it->t][it->x][1],dp[i][j][1]+times[it->x][i+it->t]);                             maxx[0]=max(maxx[0],dp[i+it->t][it->x][0]);                            maxx[1]=max(maxx[1],dp[i+it->t][it->x][1]);                        }                    }                    if(i+1<=t)                    {                        dp[i+1][j][0]=max(dp[i+1][j][0],dp[i][j][0]+times[j][i+1]);                        dp[i+1][j][1]=max(dp[i+1][j][1],dp[i][j][0]+alltime[j][i+1]);                        dp[i+1][j][1]=max(dp[i+1][j][1],dp[i][j][1]+times[j][i+1]);                        maxx[0]=max(maxx[0],dp[i+1][j][0]);                        maxx[1]=max(maxx[1],dp[i+1][j][1]);                    }                }            }        printf("%d %d\n",maxx[1],maxx[0]);    }    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-17 03:29:10, Gzip enabled