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_20613617_27120.cpp:6:25: error: stray '#' in program
     using namespace std;#define inf 1<<30 struct Point{    int x,y;}point[17]; int n,m,ans,val[17],dp1[1<<17];int dp[1<<17][17],best[1<<17];int Ok[1<<17];int dist[17][17]; int Get_Dist(int i,int j){    return ceil(sqrt(double(point[i].x-point[j].x)*(point[i].x-point[j].x)+double(point[i].y-point[j].y)*(point[i].y-point[j].y)));} int Judge(int state){    int sum=0;    for(int i=0;i<n;i++){        if(state&(1<<i))sum+=val[i];    }    return sum<=m;} int Solve(){    fill(dp1,dp1+(1<<n),inf);    dp1[0]=0;    for(int state=0;state<(1<<n);state++){        if(Ok[state]){            for(int i=0;i<(1<<n);i++){                if((state&i)==0&&dp1[i]!=inf){                    dp1[state|i]=min(dp1[state|i],dp1[i]+1);                }            }        }    }    return dp1[(1<<n)-1];} int TSP(){    fill(best,best+(1<<n),inf);    for(int i=0;i<(1<<n);i++)        for(int j=0;j<n;j++)dp[i][j]=inf;    dp[1][0]=0;    for(int state=0;state<(1<<n);state++){        if(Ok[state]){            for(int i=0;i<n;i++)if(state&(1<<i)){                if(dp[state][i]==inf)continue;                best[state]=min(best[state],dp[state][i]+dist[i][0]);                for(int j=0;j<n;j++)if(!(state&(1<<j))){                    dp[state|(1<<j)][j]=min(dp[state|(1<<j)][j],dp[state][i]+dist[i][j]);                }            }        }    }    for(int state=0;state<(1<<n);state++){        if(state&1){            for(int substate=state&(state-1);substate;substate=state&(substate-1)){                best[state]=min(best[state],best[substate]+best[(state^substate)|1]);            }        }    }    return best[(1<<n)-1];} int main(){    while(~scanf("%d%d",&n,&m)){        for(int i=0;i<n;i++)scanf("%d%d",&point[i].x,&point[i].y);        for(int i=0;i<n;i++)scanf("%d",&val[i]);        for(int i=0;i<n;i++)            for(int j=0;j<n;j++)dist[i][j]=Get_Dist(i,j);        for(int s=0;s<(1<<n);s++){            Ok[s]=Judge(s);        }        ans=Solve();        if(ans==inf){            puts("-1 -1");            continue;        }        printf("%d %d\n",ans,TSP());    }    return 0;}
                         ^
0_0_20613617_27120.cpp:6:26: error: 'define' does not name a type
     using namespace std;#define inf 1<<30 struct Point{    int x,y;}point[17]; int n,m,ans,val[17],dp1[1<<17];int dp[1<<17][17],best[1<<17];int Ok[1<<17];int dist[17][17]; int Get_Dist(int i,int j){    return ceil(sqrt(double(point[i].x-point[j].x)*(point[i].x-point[j].x)+double(point[i].y-point[j].y)*(point[i].y-point[j].y)));} int Judge(int state){    int sum=0;    for(int i=0;i<n;i++){        if(state&(1<<i))sum+=val[i];    }    return sum<=m;} int Solve(){    fill(dp1,dp1+(1<<n),inf);    dp1[0]=0;    for(int state=0;state<(1<<n);state++){        if(Ok[state]){            for(int i=0;i<(1<<n);i++){                if((state&i)==0&&dp1[i]!=inf){                    dp1[state|i]=min(dp1[state|i],dp1[i]+1);                }            }        }    }    return dp1[(1<<n)-1];} int TSP(){    fill(best,best+(1<<n),inf);    for(int i=0;i<(1<<n);i++)        for(int j=0;j<n;j++)dp[i][j]=inf;    dp[1][0]=0;    for(int state=0;state<(1<<n);state++){        if(Ok[state]){            for(int i=0;i<n;i++)if(state&(1<<i)){                if(dp[state][i]==inf)continue;                best[state]=min(best[state],dp[state][i]+dist[i][0]);                for(int j=0;j<n;j++)if(!(state&(1<<j))){                    dp[state|(1<<j)][j]=min(dp[state|(1<<j)][j],dp[state][i]+dist[i][j]);                }            }        }    }    for(int state=0;state<(1<<n);state++){        if(state&1){            for(int substate=state&(state-1);substate;substate=state&(substate-1)){                best[state]=min(best[state],best[substate]+best[(state^substate)|1]);            }        }    }    return best[(1<<n)-1];} int main(){    while(~scanf("%d%d",&n,&m)){        for(int i=0;i<n;i++)scanf("%d%d",&point[i].x,&point[i].y);        for(int i=0;i<n;i++)scanf("%d",&val[i]);        for(int i=0;i<n;i++)            for(int j=0;j<n;j++)dist[i][j]=Get_Dist(i,j);        for(int s=0;s<(1<<n);s++){            Ok[s]=Judge(s);        }        ans=Solve();        if(ans==inf){            puts("-1 -1");            continue;        }        printf("%d %d\n",ans,TSP());    }    return 0;}
                          ^
0_0_20613617_27120.cpp:6:69: error: 'point' does not name a type
     using namespace std;#define inf 1<<30 struct Point{    int x,y;}point[17]; int n,m,ans,val[17],dp1[1<<17];int dp[1<<17][17],best[1<<17];int Ok[1<<17];int dist[17][17]; int Get_Dist(int i,int j){    return ceil(sqrt(double(point[i].x-point[j].x)*(point[i].x-point[j].x)+double(point[i].y-point[j].y)*(point[i].y-point[j].y)));} int Judge(int state){    int sum=0;    for(int i=0;i<n;i++){        if(state&(1<<i))sum+=val[i];    }    return sum<=m;} int Solve(){    fill(dp1,dp1+(1<<n),inf);    dp1[0]=0;    for(int state=0;state<(1<<n);state++){        if(Ok[state]){            for(int i=0;i<(1<<n);i++){                if((state&i)==0&&dp1[i]!=inf){                    dp1[state|i]=min(dp1[state|i],dp1[i]+1);                }            }        }    }    return dp1[(1<<n)-1];} int TSP(){    fill(best,best+(1<<n),inf);    for(int i=0;i<(1<<n);i++)        for(int j=0;j<n;j++)dp[i][j]=inf;    dp[1][0]=0;    for(int state=0;state<(1<<n);state++){        if(Ok[state]){            for(int i=0;i<n;i++)if(state&(1<<i)){                if(dp[state][i]==inf)continue;                best[state]=min(best[state],dp[state][i]+dist[i][0]);                for(int j=0;j<n;j++)if(!(state&(1<<j))){                    dp[state|(1<<j)][j]=min(dp[state|(1<<j)][j],dp[state][i]+dist[i][j]);                }            }        }    }    for(int state=0;state<(1<<n);state++){        if(state&1){            for(int substate=state&(state-1);substate;substate=state&(substate-1)){                best[state]=min(best[state],best[substate]+best[(state^substate)|1]);            }        }    }    return best[(1<<n)-1];} int main(){    while(~scanf("%d%d",&n,&m)){        for(int i=0;i<n;i++)scanf("%d%d",&point[i].x,&point[i].y);        for(int i=0;i<n;i++)scanf("%d",&val[i]);        for(int i=0;i<n;i++)            for(int j=0;j<n;j++)dist[i][j]=Get_Dist(i,j);        for(int s=0;s<(1<<n);s++){            Ok[s]=Judge(s);        }        ans=Solve();        if(ans==inf){            puts("-1 -1");            continue;        }        printf("%d %d\n",ans,TSP());    }    return 0;}
                                                                     ^
0_0_20613617_27120.cpp: In function 'int Get_Dist(int, int)':
0_0_20613617_27120.cpp:6:227: error: 'point' was not declared in this scope
     using namespace std;#define inf 1<<30 struct Point{    int x,y;}point[17]; int n,m,ans,val[17],dp1[1<<17];int dp[1<<17][17],best[1<<17];int Ok[1<<17];int dist[17][17]; int Get_Dist(int i,int j){    return ceil(sqrt(double(point[i].x-point[j].x)*(point[i].x-point[j].x)+double(point[i].y-point[j].y)*(point[i].y-point[j].y)));} int Judge(int state){    int sum=0;    for(int i=0;i<n;i++){        if(state&(1<<i))sum+=val[i];    }    return sum<=m;} int Solve(){    fill(dp1,dp1+(1<<n),inf);    dp1[0]=0;    for(int state=0;state<(1<<n);state++){        if(Ok[state]){            for(int i=0;i<(1<<n);i++){                if((state&i)==0&&dp1[i]!=inf){                    dp1[state|i]=min(dp1[state|i],dp1[i]+1);                }            }        }    }    return dp1[(1<<n)-1];} int TSP(){    fill(best,best+(1<<n),inf);    for(int i=0;i<(1<<n);i++)        for(int j=0;j<n;j++)dp[i][j]=inf;    dp[1][0]=0;    for(int state=0;state<(1<<n);state++){        if(Ok[state]){            for(int i=0;i<n;i++)if(state&(1<<i)){                if(dp[state][i]==inf)continue;                best[state]=min(best[state],dp[state][i]+dist[i][0]);                for(int j=0;j<n;j++)if(!(state&(1<<j))){                    dp[state|(1<<j)][j]=min(dp[state|(1<<j)][j],dp[state][i]+dist[i][j]);                }            }        }    }    for(int state=0;state<(1<<n);state++){        if(state&1){            for(int substate=state&(state-1);substate;substate=state&(substate-1)){                best[state]=min(best[state],best[substate]+best[(state^substate)|1]);            }        }    }    return best[(1<<n)-1];} int main(){    while(~scanf("%d%d",&n,&m)){        for(int i=0;i<n;i++)scanf("%d%d",&point[i].x,&point[i].y);        for(int i=0;i<n;i++)scanf("%d",&val[i]);        for(int i=0;i<n;i++)            for(int j=0;j<n;j++)dist[i][j]=Get_Dist(i,j);        for(int s=0;s<(1<<n);s++){            Ok[s]=Judge(s);        }        ans=Solve();        if(ans==inf){            puts("-1 -1");            continue;        }        printf("%d %d\n",ans,TSP());    }    return 0;}
                                                                                                                                                                                                                                   ^
0_0_20613617_27120.cpp: In function 'int Solve()':
0_0_20613617_27120.cpp:6:489: error: 'inf' was not declared in this scope
     using namespace std;#define inf 1<<30 struct Point{    int x,y;}point[17]; int n,m,ans,val[17],dp1[1<<17];int dp[1<<17][17],best[1<<17];int Ok[1<<17];int dist[17][17]; int Get_Dist(int i,int j){    return ceil(sqrt(double(point[i].x-point[j].x)*(point[i].x-point[j].x)+double(point[i].y-point[j].y)*(point[i].y-point[j].y)));} int Judge(int state){    int sum=0;    for(int i=0;i<n;i++){        if(state&(1<<i))sum+=val[i];    }    return sum<=m;} int Solve(){    fill(dp1,dp1+(1<<n),inf);    dp1[0]=0;    for(int state=0;state<(1<<n);state++){        if(Ok[state]){            for(int i=0;i<(1<<n);i++){                if((state&i)==0&&dp1[i]!=inf){                    dp1[state|i]=min(dp1[state|i],dp1[i]+1);                }            }        }    }    return dp1[(1<<n)-1];} int TSP(){    fill(best,best+(1<<n),inf);    for(int i=0;i<(1<<n);i++)        for(int j=0;j<n;j++)dp[i][j]=inf;    dp[1][0]=0;    for(int state=0;state<(1<<n);state++){        if(Ok[state]){            for(int i=0;i<n;i++)if(state&(1<<i)){                if(dp[


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 06:13:12, Gzip enabled