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_20611426_11055.cpp:6:25: error: stray '#' in program
     using namespace std;#define N 510struct node{    int nt;    int cost;    int x1,x2,y1,y2;}s[N];vector<int> g[N];int linker[N];bool vis[N];bool dfs(int u){    for(int i=0;i<g[u].size();i++){        int v=g[u][i];        if(!vis[v]){            vis[v]=1;            if(linker[v]==-1||dfs(linker[v])){                linker[v]=u;                return true;            }        }    }    return false;}int hungary(int n){    memset(linker,-1,sizeof(linker));    int cnt=0;    for(int i=0;i<n;i++){        memset(vis,0,sizeof(vis));        if(dfs(i)) cnt++;    }    return cnt;}int main(){    int t,n;    scanf("%d",&t);    char str[7];    while(t--){        scanf("%d",&n);        int st,cost;        int x1,y1,x2,y2;        for(int i=0;i<n;i++){            scanf("%s",str);            g[i].clear();            st=((str[0]-'0')*10+(str[1]-'0'))*60+(str[3]-'0')*10+(str[4]-'0');            scanf("%d%d%d%d",&x1,&y1,&x2,&y2);            cost=abs(x1-x2)+abs(y1-y2);            s[i].nt=st;            s[i].cost=cost;            s[i].x1=x1;            s[i].x2=x2;            s[i].y1=y1;            s[i].y2=y2;        }        for(int i=0;i<n;i++){            for(int j=i+1;j<n;j++){                if(s[i].nt+s[i].cost+1+abs(s[i].x2-s[j].x1)+abs(s[i].y2-s[j].y1)<=s[j].nt){                    g[i].push_back(j);                }            }        }        printf("%d\n",n-hungary(n));    }    return 0;}
                         ^
0_0_20611426_11055.cpp:6:26: error: 'define' does not name a type
     using namespace std;#define N 510struct node{    int nt;    int cost;    int x1,x2,y1,y2;}s[N];vector<int> g[N];int linker[N];bool vis[N];bool dfs(int u){    for(int i=0;i<g[u].size();i++){        int v=g[u][i];        if(!vis[v]){            vis[v]=1;            if(linker[v]==-1||dfs(linker[v])){                linker[v]=u;                return true;            }        }    }    return false;}int hungary(int n){    memset(linker,-1,sizeof(linker));    int cnt=0;    for(int i=0;i<n;i++){        memset(vis,0,sizeof(vis));        if(dfs(i)) cnt++;    }    return cnt;}int main(){    int t,n;    scanf("%d",&t);    char str[7];    while(t--){        scanf("%d",&n);        int st,cost;        int x1,y1,x2,y2;        for(int i=0;i<n;i++){            scanf("%s",str);            g[i].clear();            st=((str[0]-'0')*10+(str[1]-'0'))*60+(str[3]-'0')*10+(str[4]-'0');            scanf("%d%d%d%d",&x1,&y1,&x2,&y2);            cost=abs(x1-x2)+abs(y1-y2);            s[i].nt=st;            s[i].cost=cost;            s[i].x1=x1;            s[i].x2=x2;            s[i].y1=y1;            s[i].y2=y2;        }        for(int i=0;i<n;i++){            for(int j=i+1;j<n;j++){                if(s[i].nt+s[i].cost+1+abs(s[i].x2-s[j].x1)+abs(s[i].y2-s[j].y1)<=s[j].nt){                    g[i].push_back(j);                }            }        }        printf("%d\n",n-hungary(n));    }    return 0;}
                          ^
0_0_20611426_11055.cpp:6:95: error: 's' does not name a type
     using namespace std;#define N 510struct node{    int nt;    int cost;    int x1,x2,y1,y2;}s[N];vector<int> g[N];int linker[N];bool vis[N];bool dfs(int u){    for(int i=0;i<g[u].size();i++){        int v=g[u][i];        if(!vis[v]){            vis[v]=1;            if(linker[v]==-1||dfs(linker[v])){                linker[v]=u;                return true;            }        }    }    return false;}int hungary(int n){    memset(linker,-1,sizeof(linker));    int cnt=0;    for(int i=0;i<n;i++){        memset(vis,0,sizeof(vis));        if(dfs(i)) cnt++;    }    return cnt;}int main(){    int t,n;    scanf("%d",&t);    char str[7];    while(t--){        scanf("%d",&n);        int st,cost;        int x1,y1,x2,y2;        for(int i=0;i<n;i++){            scanf("%s",str);            g[i].clear();            st=((str[0]-'0')*10+(str[1]-'0'))*60+(str[3]-'0')*10+(str[4]-'0');            scanf("%d%d%d%d",&x1,&y1,&x2,&y2);            cost=abs(x1-x2)+abs(y1-y2);            s[i].nt=st;            s[i].cost=cost;            s[i].x1=x1;            s[i].x2=x2;            s[i].y1=y1;            s[i].y2=y2;        }        for(int i=0;i<n;i++){            for(int j=i+1;j<n;j++){                if(s[i].nt+s[i].cost+1+abs(s[i].x2-s[j].x1)+abs(s[i].y2-s[j].y1)<=s[j].nt){                    g[i].push_back(j);                }            }        }        printf("%d\n",n-hungary(n));    }    return 0;}
                                                                                               ^
0_0_20611426_11055.cpp:6:114: error: 'N' was not declared in this scope
     using namespace std;#define N 510struct node{    int nt;    int cost;    int x1,x2,y1,y2;}s[N];vector<int> g[N];int linker[N];bool vis[N];bool dfs(int u){    for(int i=0;i<g[u].size();i++){        int v=g[u][i];        if(!vis[v]){            vis[v]=1;            if(linker[v]==-1||dfs(linker[v])){                linker[v]=u;                return true;            }        }    }    return false;}int hungary(int n){    memset(linker,-1,sizeof(linker));    int cnt=0;    for(int i=0;i<n;i++){        memset(vis,0,sizeof(vis));        if(dfs(i)) cnt++;    }    return cnt;}int main(){    int t,n;    scanf("%d",&t);    char str[7];    while(t--){        scanf("%d",&n);        int st,cost;        int x1,y1,x2,y2;        for(int i=0;i<n;i++){            scanf("%s",str);            g[i].clear();            st=((str[0]-'0')*10+(str[1]-'0'))*60+(str[3]-'0')*10+(str[4]-'0');            scanf("%d%d%d%d",&x1,&y1,&x2,&y2);            cost=abs(x1-x2)+abs(y1-y2);            s[i].nt=st;            s[i].cost=cost;            s[i].x1=x1;            s[i].x2=x2;            s[i].y1=y1;            s[i].y2=y2;        }        for(int i=0;i<n;i++){            for(int j=i+1;j<n;j++){                if(s[i].nt+s[i].cost+1+abs(s[i].x2-s[j].x1)+abs(s[i].y2-s[j].y1)<=s[j].nt){                    g[i].push_back(j);                }            }        }        printf("%d\n",n-hungary(n));    }    return 0;}
                                                                                                                  ^
0_0_20611426_11055.cpp:6:128: error: 'N' was not declared in this scope
     using namespace std;#define N 510struct node{    int nt;    int cost;    int x1,x2,y1,y2;}s[N];vector<int> g[N];int linker[N];bool vis[N];bool dfs(int u){    for(int i=0;i<g[u].size();i++){        int v=g[u][i];        if(!vis[v]){            vis[v]=1;            if(linker[v]==-1||dfs(linker[v])){                linker[v]=u;                return true;            }        }    }    return false;}int hungary(int n){    memset(linker,-1,sizeof(linker));    int cnt=0;    for(int i=0;i<n;i++){        memset(vis,0,sizeof(vis));        if(dfs(i)) cnt++;    }    return cnt;}int main(){    int t,n;    scanf("%d",&t);    char str[7];    while(t--){        scanf("%d",&n);        int st,cost;        int x1,y1,x2,y2;        for(int i=0;i<n;i++){            scanf("%s",str);            g[i].clear();            st=((str[0]-'0')*10+(str[1]-'0'))*60+(str[3]-'0')*10+(str[4]-'0');            scanf("%d%d%d%d",&x1,&y1,&x2,&y2);            cost=abs(x1-x2)+abs(y1-y2);            s[i].nt=st;            s[i].cost=cost;            s[i].x1=x1;            s[i].x2=x2;            s[i].y1=y1;            s[i].y2=y2;        }        for(int i=0;i<n;i++){            for(int j=i+1;j<n;j++){                if(s[i].nt+s[i].cost+1+abs(s[i].x2-s[j].x1)+abs(s[i].y2-s[j].y1)<=s[j].nt){                    g[i].push_back(j);                }            }        }        printf("%d\n",n-hungary(n));    }    return 0;}
                                                                                                                                ^
0_0_20611426_11055.cpp:6:140: error: 'N' was not declared in this scope
     using namespace std;#define N 510struct node{    int nt;    int cost;    int x1,x2,y1,y2;}s[N];vector<int> g[N];int linker[N];bool vis[N];bool dfs(int u){    for(int i=0;i<g[u].size();i++){        int v=g[u][i];        if(!vis[v]){            vis[v]=1;            if(linker[v]==-1||dfs(linker[v])){                linker[v]=u;                return true;            }        }    }    return false;}int hungary(int n){    memset(linker,-1,sizeof(linker));    int cnt=0;    for(int i=0;i<n;i++){        memset(vis,0,sizeof(vis));        if(dfs(i)) cnt++;    }    return cnt;}int main(){    int t,n;    scanf("%d",&t);    char str[7];    while(t--){        scanf("%d",&n);        int st,cost;        int x1,y1,x2,y2;        for(int i=0;i<n;i++){            scanf("%s",str);            g[i].clear();            st=((str[0]-'0')*10+(str[1]-'0'))*60+(str[3]-'0')*10+(str[4]-'0');            scanf("%d%d%d%d",&x1,&y1,&x2,&y2);            cost=abs(x1-x2)+abs(y1-y2);            s[i].nt=st;            s[i].cost=cost;            s[i].x1=x1;            s[i].x2=x2;            s[i].y1=y1;            s[i].y2=y2;        }        for(int i=0;i<n;i++){            for(int j=i+1;j<n;j++){                if(s[i].nt+s[i].cost+1+abs(s[i].x2-s[j].x1)+abs(s[i].y2-s[j].y1)<=s[j].nt){                    g[i].push_back(j);                }            }        }        printf("%d\n",n-hungary(n));    }    return 0;}
                                                                                                                                            ^
0_0_20611426_11055.cpp: In function 'bool dfs(int)':
0_0_20611426_11055.cpp:6:177: error: 'g' was not declared in this scope
     using namespace std;#define N 510struct node{    int nt;    int cost;    int x1,x2,y1,y2;}s[N];vector<int> g[N];int linker[N];bool vis[N];bool dfs(int u){    for(int i=0;i<g[u].size();i++){        int v=g[u][i];        if(!vis[v]){            vis[v]=1;            if(linker[v]==-1||dfs(linker[v])){                linker[v]=u;                return true;            }        }    }    return false;}int hungary(int n){    memset(linker,-1,sizeof(linker));    int cnt=0;    for(int i=0;i<n;i++){        memset(vis,0,sizeof(vis));        if(dfs(i)) cnt++;    }    return cnt;}int main(){    int t,n;    scanf("%d",&t);    char str[7];    while(t--){        scanf("%d",&n


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-26 14:28:34, Gzip enabled