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_20613980_17370.cpp:7:25: error: stray '#' in program
     using namespace std;#define N 110#define INF (1e9)+5int graph[N][N],cut[N][N];int n; bool check(vector<int>v){    if(v.size()<=1) return true;    int bridge=INF;    for(int i=0;i<v.size();++i)        for(int j=0;j<v.size();++j)        bridge=min(bridge,cut[v[i]][v[j]]);    vector<int>v0,v1;    for(int i=0,x=v[0];i<v.size();++i)    {        if(cut[v[i]][x]>bridge) v0.push_back(v[i]);        else v1.push_back(v[i]);    }    if(v0.empty()||v1.empty()) return false;    for(int i=0;i<v0.size();++i)        for(int j=0;j<v1.size();++j)        {            if(cut[v0[i]][v1[j]]!=bridge) return false;        }    graph[v0[0]][v1[0]]=graph[v1[0]][v0[0]]=bridge;    return check(v0)&&check(v1);}int main (){    while(scanf("%d",&n)!=EOF)    {        for(int i=1;i<=n;++i)        {            for(int j=1;j<=n;++j)                scanf("%d",&cut[i][j]);            cut[i][i]=INF;        }        memset(graph,0,sizeof(graph));        vector<int>v;        for(int i=1;i<=n;++i) v.push_back(i);        if(check(v))        {            for(int i=1;i<=n;++i) graph[i][i]=-1;            printf("YES\n");            for(int i=1;i<=n;++i)                for(int j=1;j<=n;++j)                {                    printf("%d",graph[i][j]);                    if(j<n) printf(" ");                    else printf("\n");                }        }        else printf("NO\n");    }    return 0;}
                         ^
0_0_20613980_17370.cpp:7:38: error: stray '#' in program
     using namespace std;#define N 110#define INF (1e9)+5int graph[N][N],cut[N][N];int n; bool check(vector<int>v){    if(v.size()<=1) return true;    int bridge=INF;    for(int i=0;i<v.size();++i)        for(int j=0;j<v.size();++j)        bridge=min(bridge,cut[v[i]][v[j]]);    vector<int>v0,v1;    for(int i=0,x=v[0];i<v.size();++i)    {        if(cut[v[i]][x]>bridge) v0.push_back(v[i]);        else v1.push_back(v[i]);    }    if(v0.empty()||v1.empty()) return false;    for(int i=0;i<v0.size();++i)        for(int j=0;j<v1.size();++j)        {            if(cut[v0[i]][v1[j]]!=bridge) return false;        }    graph[v0[0]][v1[0]]=graph[v1[0]][v0[0]]=bridge;    return check(v0)&&check(v1);}int main (){    while(scanf("%d",&n)!=EOF)    {        for(int i=1;i<=n;++i)        {            for(int j=1;j<=n;++j)                scanf("%d",&cut[i][j]);            cut[i][i]=INF;        }        memset(graph,0,sizeof(graph));        vector<int>v;        for(int i=1;i<=n;++i) v.push_back(i);        if(check(v))        {            for(int i=1;i<=n;++i) graph[i][i]=-1;            printf("YES\n");            for(int i=1;i<=n;++i)                for(int j=1;j<=n;++j)                {                    printf("%d",graph[i][j]);                    if(j<n) printf(" ");                    else printf("\n");                }        }        else printf("NO\n");    }    return 0;}
                                      ^
0_0_20613980_17370.cpp:7:26: error: 'define' does not name a type
     using namespace std;#define N 110#define INF (1e9)+5int graph[N][N],cut[N][N];int n; bool check(vector<int>v){    if(v.size()<=1) return true;    int bridge=INF;    for(int i=0;i<v.size();++i)        for(int j=0;j<v.size();++j)        bridge=min(bridge,cut[v[i]][v[j]]);    vector<int>v0,v1;    for(int i=0,x=v[0];i<v.size();++i)    {        if(cut[v[i]][x]>bridge) v0.push_back(v[i]);        else v1.push_back(v[i]);    }    if(v0.empty()||v1.empty()) return false;    for(int i=0;i<v0.size();++i)        for(int j=0;j<v1.size();++j)        {            if(cut[v0[i]][v1[j]]!=bridge) return false;        }    graph[v0[0]][v1[0]]=graph[v1[0]][v0[0]]=bridge;    return check(v0)&&check(v1);}int main (){    while(scanf("%d",&n)!=EOF)    {        for(int i=1;i<=n;++i)        {            for(int j=1;j<=n;++j)                scanf("%d",&cut[i][j]);            cut[i][i]=INF;        }        memset(graph,0,sizeof(graph));        vector<int>v;        for(int i=1;i<=n;++i) v.push_back(i);        if(check(v))        {            for(int i=1;i<=n;++i) graph[i][i]=-1;            printf("YES\n");            for(int i=1;i<=n;++i)                for(int j=1;j<=n;++j)                {                    printf("%d",graph[i][j]);                    if(j<n) printf(" ");                    else printf("\n");                }        }        else printf("NO\n");    }    return 0;}
                          ^
0_0_20613980_17370.cpp: In function 'bool check(std::vector<int>)':
0_0_20613980_17370.cpp:7:162: error: 'INF' was not declared in this scope
     using namespace std;#define N 110#define INF (1e9)+5int graph[N][N],cut[N][N];int n; bool check(vector<int>v){    if(v.size()<=1) return true;    int bridge=INF;    for(int i=0;i<v.size();++i)        for(int j=0;j<v.size();++j)        bridge=min(bridge,cut[v[i]][v[j]]);    vector<int>v0,v1;    for(int i=0,x=v[0];i<v.size();++i)    {        if(cut[v[i]][x]>bridge) v0.push_back(v[i]);        else v1.push_back(v[i]);    }    if(v0.empty()||v1.empty()) return false;    for(int i=0;i<v0.size();++i)        for(int j=0;j<v1.size();++j)        {            if(cut[v0[i]][v1[j]]!=bridge) return false;        }    graph[v0[0]][v1[0]]=graph[v1[0]][v0[0]]=bridge;    return check(v0)&&check(v1);}int main (){    while(scanf("%d",&n)!=EOF)    {        for(int i=1;i<=n;++i)        {            for(int j=1;j<=n;++j)                scanf("%d",&cut[i][j]);            cut[i][i]=INF;        }        memset(graph,0,sizeof(graph));        vector<int>v;        for(int i=1;i<=n;++i) v.push_back(i);        if(check(v))        {            for(int i=1;i<=n;++i) graph[i][i]=-1;            printf("YES\n");            for(int i=1;i<=n;++i)                for(int j=1;j<=n;++j)                {                    printf("%d",graph[i][j]);                    if(j<n) printf(" ");                    else printf("\n");                }        }        else printf("NO\n");    }    return 0;}
                                                                                                                                                                  ^
0_0_20613980_17370.cpp:7:258: error: 'cut' was not declared in this scope
     using namespace std;#define N 110#define INF (1e9)+5int graph[N][N],cut[N][N];int n; bool check(vector<int>v){    if(v.size()<=1) return true;    int bridge=INF;    for(int i=0;i<v.size();++i)        for(int j=0;j<v.size();++j)        bridge=min(bridge,cut[v[i]][v[j]]);    vector<int>v0,v1;    for(int i=0,x=v[0];i<v.size();++i)    {        if(cut[v[i]][x]>bridge) v0.push_back(v[i]);        else v1.push_back(v[i]);    }    if(v0.empty()||v1.empty()) return false;    for(int i=0;i<v0.size();++i)        for(int j=0;j<v1.size();++j)        {            if(cut[v0[i]][v1[j]]!=bridge) return false;        }    graph[v0[0]][v1[0]]=graph[v1[0]][v0[0]]=bridge;    return check(v0)&&check(v1);}int main (){    while(scanf("%d",&n)!=EOF)    {        for(int i=1;i<=n;++i)        {            for(int j=1;j<=n;++j)                scanf("%d",&cut[i][j]);            cut[i][i]=INF;        }        memset(graph,0,sizeof(graph));        vector<int>v;        for(int i=1;i<=n;++i) v.push_back(i);        if(check(v))        {            for(int i=1;i<=n;++i) graph[i][i]=-1;            printf("YES\n");            for(int i=1;i<=n;++i)                for(int j=1;j<=n;++j)                {                    printf("%d",graph[i][j]);                    if(j<n) printf(" ");                    else printf("\n");                }        }        else printf("NO\n");    }    return 0;}
                                                                                                                                                                                                                                                                  ^
0_0_20613980_17370.cpp:7:350: error: 'cut' was not declared in this scope
     using namespace std;#define N 110#define INF (1e9)+5int graph[N][N],cut[N][N];int n; bool check(vector<int>v){    if(v.size()<=1) return true;    int bridge=INF;    for(int i=0;i<v.size();++i)        for(int j=0;j<v.size();++j)        bridge=min(bridge,cut[v[i]][v[j]]);    vector<int>v0,v1;    for(int i=0,x=v[0];i<v.size();++i)    {        if(cut[v[i]][x]>bridge) v0.push_back(v[i]);        else v1.push_back(v[i]);    }    if(v0.empty()||v1.empty()) return false;    for(int i=0;i<v0.size();++i)        for(int j=0;j<v1.size();++j)        {            if(cut[v0[i]][v1[j]]!=bridge) return false;        }    graph[v0[0]][v1[0]]=graph[v1[0]][v0[0]]=bridge;    return check(v0)&&check(v1);}int main (){    while(scanf("%d",&n)!=EOF)    {        for(int i=1;i<=n;++i)        {            for(int j=1;j<=n;++j)                scanf("%d",&cut[i][j]);            cut[i][i]=INF;        }        memset(graph,0,sizeof(graph));        vector<int>v;        for(int i=1;i<=n;++i) v.push_back(i);        if(check(v))        {            for(int i=1;i<=n;++i) graph[i][i]=-1;            printf("YES\n");            for(int i=1;i<=n;++i)                for(int j=1;j<=n;++j)                {                    printf("%d",graph[i][j]);                    if(j<n) printf(" ");                    else printf("\n");                }        }        else printf("NO\n");    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                              ^
0_0_20613980_17370.cpp:7:563: error: 'cut' was not declared in this scope
     using namespace std;#define N 110#define INF (1e9)+5int graph[N][N],cut[N][N];int n; bool check(vector<int>v){    if(v.size()<=1) return true;    int bridge=INF;    for(int i=0;i<v.size();++i)        for(int j=0;j<v.size();++j)        bridge=min(bridge,cut[v[i]][v[j]]);    vector<int>v0,v1;    for(int i=0,x=v[0];i<v.size();++i)    {        if(cut[v[i]][x]>bridge) v0.push_back(v[i]);        else v1.push_back(v[i]);    }    if(v0.empty()||v1.


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 06:03:23, Gzip enabled