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_20614376_23487.cpp:7:25: error: stray '#' in program
     using namespace std;#define MP make_pair#define PB push_backconst int N=10005;vector<int> mp[N],rv[N];map< pair<int,int>,int > vis;int f[N],p2i[N][N];int dp[N*N][2];int n,m;struct Dt{    int v,turn;    Dt(){}    Dt(int _v,int _turn){ v=_v; turn=_turn; }};queue<Dt> que;void init(){    int id=0;    for(int i=1;i<=n;++i)        for(int j=i;j<=n;++j)            p2i[j][i]=p2i[i][j]=id++;    for(int i=0;i<id;++i){        mp[i].clear();        rv[i].clear();    }    vis.clear();    for(int i=0;i<id;++i){        dp[i][0]=dp[i][1]=0;    }}int main(){    int T;    scanf("%d",&T);    while(T--){        scanf("%d%d",&n,&m);        init();        for(int i=0;i<m;++i){            for(int j=1;j<=n;++j)                scanf("%d",&f[j]);            for(int j=1;j<=n;++j)                for(int k=j+1;k<=n;++k){                    int fr=p2i[j][k];                    int to=p2i[f[j]][f[k]];                    if(vis[MP(fr,to)]==0){                        mp[fr].PB(to);                        rv[to].PB(fr);                        vis[MP(fr,to)]=1;                    }                }        }        for(int i=1;i<=n;++i){            que.push(Dt(p2i[i][i],0));            que.push(Dt(p2i[i][i],1));            dp[p2i[i][i]][0]=dp[p2i[i][i]][1]=1;        }        while(!que.empty()){            Dt now=que.front();            que.pop();            if(now.turn==0){                int to=now.v;                for(int i=0;i<rv[to].size();++i){                    int fr=rv[to][i];                    if(dp[fr][1]==0){                        int st=1;                        for(int i=0;i<mp[fr].size();++i)                            st&=dp[mp[fr][i]][0];                        dp[fr][1]=st;                        if(dp[fr][1])                            que.push(Dt(fr,1));                    }                }            }            else{                int to=now.v;                for(int i=0;i<rv[to].size();++i){                    int fr=rv[to][i];                    if(dp[fr][0]==0){                        dp[fr][0]=1;                        que.push(Dt(fr,0));                    }                }            }        }        int ans=1;        for(int i=1;i<=n;++i){            for(int j=i;j<=n;++j){                ans&=dp[p2i[i][j]][0];            }        }        if(ans) puts("YES");        else puts("NO");    }    return 0;}
                         ^
0_0_20614376_23487.cpp:7:45: error: stray '#' in program
     using namespace std;#define MP make_pair#define PB push_backconst int N=10005;vector<int> mp[N],rv[N];map< pair<int,int>,int > vis;int f[N],p2i[N][N];int dp[N*N][2];int n,m;struct Dt{    int v,turn;    Dt(){}    Dt(int _v,int _turn){ v=_v; turn=_turn; }};queue<Dt> que;void init(){    int id=0;    for(int i=1;i<=n;++i)        for(int j=i;j<=n;++j)            p2i[j][i]=p2i[i][j]=id++;    for(int i=0;i<id;++i){        mp[i].clear();        rv[i].clear();    }    vis.clear();    for(int i=0;i<id;++i){        dp[i][0]=dp[i][1]=0;    }}int main(){    int T;    scanf("%d",&T);    while(T--){        scanf("%d%d",&n,&m);        init();        for(int i=0;i<m;++i){            for(int j=1;j<=n;++j)                scanf("%d",&f[j]);            for(int j=1;j<=n;++j)                for(int k=j+1;k<=n;++k){                    int fr=p2i[j][k];                    int to=p2i[f[j]][f[k]];                    if(vis[MP(fr,to)]==0){                        mp[fr].PB(to);                        rv[to].PB(fr);                        vis[MP(fr,to)]=1;                    }                }        }        for(int i=1;i<=n;++i){            que.push(Dt(p2i[i][i],0));            que.push(Dt(p2i[i][i],1));            dp[p2i[i][i]][0]=dp[p2i[i][i]][1]=1;        }        while(!que.empty()){            Dt now=que.front();            que.pop();            if(now.turn==0){                int to=now.v;                for(int i=0;i<rv[to].size();++i){                    int fr=rv[to][i];                    if(dp[fr][1]==0){                        int st=1;                        for(int i=0;i<mp[fr].size();++i)                            st&=dp[mp[fr][i]][0];                        dp[fr][1]=st;                        if(dp[fr][1])                            que.push(Dt(fr,1));                    }                }            }            else{                int to=now.v;                for(int i=0;i<rv[to].size();++i){                    int fr=rv[to][i];                    if(dp[fr][0]==0){                        dp[fr][0]=1;                        que.push(Dt(fr,0));                    }                }            }        }        int ans=1;        for(int i=1;i<=n;++i){            for(int j=i;j<=n;++j){                ans&=dp[p2i[i][j]][0];            }        }        if(ans) puts("YES");        else puts("NO");    }    return 0;}
                                             ^
0_0_20614376_23487.cpp:7:26: error: 'define' does not name a type
     using namespace std;#define MP make_pair#define PB push_backconst int N=10005;vector<int> mp[N],rv[N];map< pair<int,int>,int > vis;int f[N],p2i[N][N];int dp[N*N][2];int n,m;struct Dt{    int v,turn;    Dt(){}    Dt(int _v,int _turn){ v=_v; turn=_turn; }};queue<Dt> que;void init(){    int id=0;    for(int i=1;i<=n;++i)        for(int j=i;j<=n;++j)            p2i[j][i]=p2i[i][j]=id++;    for(int i=0;i<id;++i){        mp[i].clear();        rv[i].clear();    }    vis.clear();    for(int i=0;i<id;++i){        dp[i][0]=dp[i][1]=0;    }}int main(){    int T;    scanf("%d",&T);    while(T--){        scanf("%d%d",&n,&m);        init();        for(int i=0;i<m;++i){            for(int j=1;j<=n;++j)                scanf("%d",&f[j]);            for(int j=1;j<=n;++j)                for(int k=j+1;k<=n;++k){                    int fr=p2i[j][k];                    int to=p2i[f[j]][f[k]];                    if(vis[MP(fr,to)]==0){                        mp[fr].PB(to);                        rv[to].PB(fr);                        vis[MP(fr,to)]=1;                    }                }        }        for(int i=1;i<=n;++i){            que.push(Dt(p2i[i][i],0));            que.push(Dt(p2i[i][i],1));            dp[p2i[i][i]][0]=dp[p2i[i][i]][1]=1;        }        while(!que.empty()){            Dt now=que.front();            que.pop();            if(now.turn==0){                int to=now.v;                for(int i=0;i<rv[to].size();++i){                    int fr=rv[to][i];                    if(dp[fr][1]==0){                        int st=1;                        for(int i=0;i<mp[fr].size();++i)                            st&=dp[mp[fr][i]][0];                        dp[fr][1]=st;                        if(dp[fr][1])                            que.push(Dt(fr,1));                    }                }            }            else{                int to=now.v;                for(int i=0;i<rv[to].size();++i){                    int fr=rv[to][i];                    if(dp[fr][0]==0){                        dp[fr][0]=1;                        que.push(Dt(fr,0));                    }                }            }        }        int ans=1;        for(int i=1;i<=n;++i){            for(int j=i;j<=n;++j){                ans&=dp[p2i[i][j]][0];            }        }        if(ans) puts("YES");        else puts("NO");    }    return 0;}
                          ^
0_0_20614376_23487.cpp:7:98: error: 'N' was not declared in this scope
     using namespace std;#define MP make_pair#define PB push_backconst int N=10005;vector<int> mp[N],rv[N];map< pair<int,int>,int > vis;int f[N],p2i[N][N];int dp[N*N][2];int n,m;struct Dt{    int v,turn;    Dt(){}    Dt(int _v,int _turn){ v=_v; turn=_turn; }};queue<Dt> que;void init(){    int id=0;    for(int i=1;i<=n;++i)        for(int j=i;j<=n;++j)            p2i[j][i]=p2i[i][j]=id++;    for(int i=0;i<id;++i){        mp[i].clear();        rv[i].clear();    }    vis.clear();    for(int i=0;i<id;++i){        dp[i][0]=dp[i][1]=0;    }}int main(){    int T;    scanf("%d",&T);    while(T--){        scanf("%d%d",&n,&m);        init();        for(int i=0;i<m;++i){            for(int j=1;j<=n;++j)                scanf("%d",&f[j]);            for(int j=1;j<=n;++j)                for(int k=j+1;k<=n;++k){                    int fr=p2i[j][k];                    int to=p2i[f[j]][f[k]];                    if(vis[MP(fr,to)]==0){                        mp[fr].PB(to);                        rv[to].PB(fr);                        vis[MP(fr,to)]=1;                    }                }        }        for(int i=1;i<=n;++i){            que.push(Dt(p2i[i][i],0));            que.push(Dt(p2i[i][i],1));            dp[p2i[i][i]][0]=dp[p2i[i][i]][1]=1;        }        while(!que.empty()){            Dt now=que.front();            que.pop();            if(now.turn==0){                int to=now.v;                for(int i=0;i<rv[to].size();++i){                    int fr=rv[to][i];                    if(dp[fr][1]==0){                        int st=1;                        for(int i=0;i<mp[fr].size();++i)                            st&=dp[mp[fr][i]][0];                        dp[fr][1]=st;                        if(dp[fr][1])                            que.push(Dt(fr,1));                    }                }            }            else{                int to=now.v;                for(int i=0;i<rv[to].size();++i){                    int fr=rv[to][i];                    if(dp[fr][0]==0){                        dp[fr][0]=1;                        que.push(Dt(fr,0));                    }                }            }        }        int ans=1;        for(int i=1;i<=n;++i){            for(int j=i;j<=n;++j){                ans&=dp[p2i[i][j]][0];            }        }        if(ans) puts("YES");        else puts("NO");    }    return 0;}
                                                                                                  ^
0_0_20614376_23487.cpp:7:104: error: 'N' was not declared in this scope
     using namespace std;#define MP make_pair#define PB push_backconst int N=10005;vector<int> mp[N],rv[N];map< pair<int,int>,int > vis;int f[N],p2i[N][N];int dp[N*N][2];int n,m;struct Dt{    int v,turn;    Dt(){}    Dt(int _v,int _turn){ v=_v; turn=_turn; }};qu


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-12-02 02:52:32, Gzip enabled