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_20612733_26734.cpp:6:25: error: stray '#' in program
     using namespace std;#define N 300int t, n, m, k, ans[N], match[N], num, match2[N];bool vst[N][N], re[N], tmp[N];vector<int> jeo[N];bool find(int id, int limit){    if (id <= limit) return false;    for(int i = 0; i < jeo[id].size(); i++)        if (!tmp[jeo[id][i]])        {            tmp[jeo[id][i]] = 1;            if (match[jeo[id][i]] == -1 || find(match[jeo[id][i]], limit))            {                match[jeo[id][i]] = id;                return true;            }        }    return false;}bool solve(){    memset(match, -1, sizeof(int) * (n + 1));    for(int i = 1; i <= n; i++)    {        memset(tmp, 0, sizeof(bool) * (n + 1));        if (!find(i, 0)) return false;    }    return true;}bool check(int id, int tar){    if(match[tar] == id) return true;    int key = 0;    for(int i = 1; i <= n; i++)        if ((match2[i] = match[i]) == id) key = i;    int t = match[tar]; match[tar] = id; match[key] = -1;    memset(tmp, 0, sizeof(bool) * (n + 1));    if (find(t, id)) return true;    else for(int i = 1; i <= n; i++)        match[i] = match2[i];    return false;}bool dfs(int deep){    if (deep == n + 1)    {        num++; if (num == k)            return true;        return false;    }    for(int i = 0; i < jeo[deep].size(); i++)        if (!re[jeo[deep][i]] && check(deep, jeo[deep][i]))        {            ans[deep] = jeo[deep][i];            re[jeo[deep][i]] = 1;            if (dfs(deep + 1)) return true;            re[jeo[deep][i]] = 0;        }    return false;}int main(){    scanf("%d", &t);    for(int ca = 1; ca <= t; ca++)    {        scanf("%d%d%d", &n, &m, &k);        for(int i = 1; i <= n; i++)            for(int j =1; j <= n; j++) vst[i][j] = 0;        for(int i = 0; i < m; i++)            for(int j = 1; j <= n; j++)            {                int x;scanf("%d", &x);vst[j][x] = 1;            }        for(int i = 1; i <= n; i++)        {            jeo[i].clear();            for(int j = 1; j <= n; j++)                if (!vst[i][j]) jeo[i].push_back(j);            sort(jeo[i].begin(), jeo[i].end());        }        memset(re, 0, sizeof(bool) * (n + 1)); num = 0;        printf("Case #%d:", ca);        if (solve() && dfs(1))        {            for(int i = 1; i <= n; i++) printf(" %d", ans[i]);            putchar('\n');        }        else printf(" -1\n");    }    return 0;}
                         ^
0_0_20612733_26734.cpp:6:26: error: 'define' does not name a type
     using namespace std;#define N 300int t, n, m, k, ans[N], match[N], num, match2[N];bool vst[N][N], re[N], tmp[N];vector<int> jeo[N];bool find(int id, int limit){    if (id <= limit) return false;    for(int i = 0; i < jeo[id].size(); i++)        if (!tmp[jeo[id][i]])        {            tmp[jeo[id][i]] = 1;            if (match[jeo[id][i]] == -1 || find(match[jeo[id][i]], limit))            {                match[jeo[id][i]] = id;                return true;            }        }    return false;}bool solve(){    memset(match, -1, sizeof(int) * (n + 1));    for(int i = 1; i <= n; i++)    {        memset(tmp, 0, sizeof(bool) * (n + 1));        if (!find(i, 0)) return false;    }    return true;}bool check(int id, int tar){    if(match[tar] == id) return true;    int key = 0;    for(int i = 1; i <= n; i++)        if ((match2[i] = match[i]) == id) key = i;    int t = match[tar]; match[tar] = id; match[key] = -1;    memset(tmp, 0, sizeof(bool) * (n + 1));    if (find(t, id)) return true;    else for(int i = 1; i <= n; i++)        match[i] = match2[i];    return false;}bool dfs(int deep){    if (deep == n + 1)    {        num++; if (num == k)            return true;        return false;    }    for(int i = 0; i < jeo[deep].size(); i++)        if (!re[jeo[deep][i]] && check(deep, jeo[deep][i]))        {            ans[deep] = jeo[deep][i];            re[jeo[deep][i]] = 1;            if (dfs(deep + 1)) return true;            re[jeo[deep][i]] = 0;        }    return false;}int main(){    scanf("%d", &t);    for(int ca = 1; ca <= t; ca++)    {        scanf("%d%d%d", &n, &m, &k);        for(int i = 1; i <= n; i++)            for(int j =1; j <= n; j++) vst[i][j] = 0;        for(int i = 0; i < m; i++)            for(int j = 1; j <= n; j++)            {                int x;scanf("%d", &x);vst[j][x] = 1;            }        for(int i = 1; i <= n; i++)        {            jeo[i].clear();            for(int j = 1; j <= n; j++)                if (!vst[i][j]) jeo[i].push_back(j);            sort(jeo[i].begin(), jeo[i].end());        }        memset(re, 0, sizeof(bool) * (n + 1)); num = 0;        printf("Case #%d:", ca);        if (solve() && dfs(1))        {            for(int i = 1; i <= n; i++) printf(" %d", ans[i]);            putchar('\n');        }        else printf(" -1\n");    }    return 0;}
                          ^
0_0_20612733_26734.cpp:6:96: error: 'N' was not declared in this scope
     using namespace std;#define N 300int t, n, m, k, ans[N], match[N], num, match2[N];bool vst[N][N], re[N], tmp[N];vector<int> jeo[N];bool find(int id, int limit){    if (id <= limit) return false;    for(int i = 0; i < jeo[id].size(); i++)        if (!tmp[jeo[id][i]])        {            tmp[jeo[id][i]] = 1;            if (match[jeo[id][i]] == -1 || find(match[jeo[id][i]], limit))            {                match[jeo[id][i]] = id;                return true;            }        }    return false;}bool solve(){    memset(match, -1, sizeof(int) * (n + 1));    for(int i = 1; i <= n; i++)    {        memset(tmp, 0, sizeof(bool) * (n + 1));        if (!find(i, 0)) return false;    }    return true;}bool check(int id, int tar){    if(match[tar] == id) return true;    int key = 0;    for(int i = 1; i <= n; i++)        if ((match2[i] = match[i]) == id) key = i;    int t = match[tar]; match[tar] = id; match[key] = -1;    memset(tmp, 0, sizeof(bool) * (n + 1));    if (find(t, id)) return true;    else for(int i = 1; i <= n; i++)        match[i] = match2[i];    return false;}bool dfs(int deep){    if (deep == n + 1)    {        num++; if (num == k)            return true;        return false;    }    for(int i = 0; i < jeo[deep].size(); i++)        if (!re[jeo[deep][i]] && check(deep, jeo[deep][i]))        {            ans[deep] = jeo[deep][i];            re[jeo[deep][i]] = 1;            if (dfs(deep + 1)) return true;            re[jeo[deep][i]] = 0;        }    return false;}int main(){    scanf("%d", &t);    for(int ca = 1; ca <= t; ca++)    {        scanf("%d%d%d", &n, &m, &k);        for(int i = 1; i <= n; i++)            for(int j =1; j <= n; j++) vst[i][j] = 0;        for(int i = 0; i < m; i++)            for(int j = 1; j <= n; j++)            {                int x;scanf("%d", &x);vst[j][x] = 1;            }        for(int i = 1; i <= n; i++)        {            jeo[i].clear();            for(int j = 1; j <= n; j++)                if (!vst[i][j]) jeo[i].push_back(j);            sort(jeo[i].begin(), jeo[i].end());        }        memset(re, 0, sizeof(bool) * (n + 1)); num = 0;        printf("Case #%d:", ca);        if (solve() && dfs(1))        {            for(int i = 1; i <= n; i++) printf(" %d", ans[i]);            putchar('\n');        }        else printf(" -1\n");    }    return 0;}
                                                                                                ^
0_0_20612733_26734.cpp:6:99: error: 'N' was not declared in this scope
     using namespace std;#define N 300int t, n, m, k, ans[N], match[N], num, match2[N];bool vst[N][N], re[N], tmp[N];vector<int> jeo[N];bool find(int id, int limit){    if (id <= limit) return false;    for(int i = 0; i < jeo[id].size(); i++)        if (!tmp[jeo[id][i]])        {            tmp[jeo[id][i]] = 1;            if (match[jeo[id][i]] == -1 || find(match[jeo[id][i]], limit))            {                match[jeo[id][i]] = id;                return true;            }        }    return false;}bool solve(){    memset(match, -1, sizeof(int) * (n + 1));    for(int i = 1; i <= n; i++)    {        memset(tmp, 0, sizeof(bool) * (n + 1));        if (!find(i, 0)) return false;    }    return true;}bool check(int id, int tar){    if(match[tar] == id) return true;    int key = 0;    for(int i = 1; i <= n; i++)        if ((match2[i] = match[i]) == id) key = i;    int t = match[tar]; match[tar] = id; match[key] = -1;    memset(tmp, 0, sizeof(bool) * (n + 1));    if (find(t, id)) return true;    else for(int i = 1; i <= n; i++)        match[i] = match2[i];    return false;}bool dfs(int deep){    if (deep == n + 1)    {        num++; if (num == k)            return true;        return false;    }    for(int i = 0; i < jeo[deep].size(); i++)        if (!re[jeo[deep][i]] && check(deep, jeo[deep][i]))        {            ans[deep] = jeo[deep][i];            re[jeo[deep][i]] = 1;            if (dfs(deep + 1)) return true;            re[jeo[deep][i]] = 0;        }    return false;}int main(){    scanf("%d", &t);    for(int ca = 1; ca <= t; ca++)    {        scanf("%d%d%d", &n, &m, &k);        for(int i = 1; i <= n; i++)            for(int j =1; j <= n; j++) vst[i][j] = 0;        for(int i = 0; i < m; i++)            for(int j = 1; j <= n; j++)            {                int x;scanf("%d", &x);vst[j][x] = 1;            }        for(int i = 1; i <= n; i++)        {            jeo[i].clear();            for(int j = 1; j <= n; j++)                if (!vst[i][j]) jeo[i].push_back(j);            sort(jeo[i].begin(), jeo[i].end());        }        memset(re, 0, sizeof(bool) * (n + 1)); num = 0;        printf("Case #%d:", ca);        if (solve() && dfs(1))        {            for(int i = 1; i <= n; i++) printf(" %d", ans[i]);            putchar('\n');        }        else printf(" -1\n");    }    return 0;}
                                                                                                   ^
0_0_20612733_26734.cpp:6:106: error: 'N' was not declared in this scope
     using namespace std;#define N 300int t, n, m, k, ans[N], match[N], num, match2[N];bool vst[N][N], re[N], tmp[N];vector<int> jeo[N];bool find(int id, int limit){    if (id <= limit) return false;    for(int i = 0; i < jeo[id].size(); i++)        if (!tmp[jeo[id][i]])     


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