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_20610525_5506.cpp:5:26: error: stray '#' in program
     using namespace std; #define maxn 35 int n, m;int d[maxn];int dir[2] = {-1, 1};bool vis[maxn]; void input(){    char st[5];     scanf("%d", &m);    m--;    for (int i = 0; i < n; i++)    {        scanf("%s", st);        if (st[0] == 'R')            d[i] = 1;        else            d[i] = 0;    }} int unify(int a){    return (a + n) % n;} void work(){    int s = m;    int t = unify(0 + dir[d[m]]);    if (t == m)        t = unify(t + dir[d[m]]);    int cnt = 1;    int ret = 1;     vis[m] = true;    memset(vis, 0, sizeof(vis));    while (cnt < n)    {        vis[s] = true;        d[s] = 1 - d[s];        ret++;        if (!vis[t])            cnt++;        int temp = unify(s + dir[d[t]]);        if (temp == t)            temp = unify(temp + dir[d[t]]);        s = t;        t = temp;    }     printf("Classmate %d got the ball last after %d tosses.\n", s + 1, ret);} int main(){    while (scanf("%d", &n), n)    {        input();        work();    }    return 0;}
                          ^
0_0_20610525_5506.cpp:5:27: error: 'define' does not name a type
     using namespace std; #define maxn 35 int n, m;int d[maxn];int dir[2] = {-1, 1};bool vis[maxn]; void input(){    char st[5];     scanf("%d", &m);    m--;    for (int i = 0; i < n; i++)    {        scanf("%s", st);        if (st[0] == 'R')            d[i] = 1;        else            d[i] = 0;    }} int unify(int a){    return (a + n) % n;} void work(){    int s = m;    int t = unify(0 + dir[d[m]]);    if (t == m)        t = unify(t + dir[d[m]]);    int cnt = 1;    int ret = 1;     vis[m] = true;    memset(vis, 0, sizeof(vis));    while (cnt < n)    {        vis[s] = true;        d[s] = 1 - d[s];        ret++;        if (!vis[t])            cnt++;        int temp = unify(s + dir[d[t]]);        if (temp == t)            temp = unify(temp + dir[d[t]]);        s = t;        t = temp;    }     printf("Classmate %d got the ball last after %d tosses.\n", s + 1, ret);} int main(){    while (scanf("%d", &n), n)    {        input();        work();    }    return 0;}
                           ^
0_0_20610525_5506.cpp:5:57: error: 'maxn' was not declared in this scope
     using namespace std; #define maxn 35 int n, m;int d[maxn];int dir[2] = {-1, 1};bool vis[maxn]; void input(){    char st[5];     scanf("%d", &m);    m--;    for (int i = 0; i < n; i++)    {        scanf("%s", st);        if (st[0] == 'R')            d[i] = 1;        else            d[i] = 0;    }} int unify(int a){    return (a + n) % n;} void work(){    int s = m;    int t = unify(0 + dir[d[m]]);    if (t == m)        t = unify(t + dir[d[m]]);    int cnt = 1;    int ret = 1;     vis[m] = true;    memset(vis, 0, sizeof(vis));    while (cnt < n)    {        vis[s] = true;        d[s] = 1 - d[s];        ret++;        if (!vis[t])            cnt++;        int temp = unify(s + dir[d[t]]);        if (temp == t)            temp = unify(temp + dir[d[t]]);        s = t;        t = temp;    }     printf("Classmate %d got the ball last after %d tosses.\n", s + 1, ret);} int main(){    while (scanf("%d", &n), n)    {        input();        work();    }    return 0;}
                                                         ^
0_0_20610525_5506.cpp:5:93: error: 'maxn' was not declared in this scope
     using namespace std; #define maxn 35 int n, m;int d[maxn];int dir[2] = {-1, 1};bool vis[maxn]; void input(){    char st[5];     scanf("%d", &m);    m--;    for (int i = 0; i < n; i++)    {        scanf("%s", st);        if (st[0] == 'R')            d[i] = 1;        else            d[i] = 0;    }} int unify(int a){    return (a + n) % n;} void work(){    int s = m;    int t = unify(0 + dir[d[m]]);    if (t == m)        t = unify(t + dir[d[m]]);    int cnt = 1;    int ret = 1;     vis[m] = true;    memset(vis, 0, sizeof(vis));    while (cnt < n)    {        vis[s] = true;        d[s] = 1 - d[s];        ret++;        if (!vis[t])            cnt++;        int temp = unify(s + dir[d[t]]);        if (temp == t)            temp = unify(temp + dir[d[t]]);        s = t;        t = temp;    }     printf("Classmate %d got the ball last after %d tosses.\n", s + 1, ret);} int main(){    while (scanf("%d", &n), n)    {        input();        work();    }    return 0;}
                                                                                             ^
0_0_20610525_5506.cpp: In function 'void input()':
0_0_20610525_5506.cpp:5:146: error: 'm' was not declared in this scope
     using namespace std; #define maxn 35 int n, m;int d[maxn];int dir[2] = {-1, 1};bool vis[maxn]; void input(){    char st[5];     scanf("%d", &m);    m--;    for (int i = 0; i < n; i++)    {        scanf("%s", st);        if (st[0] == 'R')            d[i] = 1;        else            d[i] = 0;    }} int unify(int a){    return (a + n) % n;} void work(){    int s = m;    int t = unify(0 + dir[d[m]]);    if (t == m)        t = unify(t + dir[d[m]]);    int cnt = 1;    int ret = 1;     vis[m] = true;    memset(vis, 0, sizeof(vis));    while (cnt < n)    {        vis[s] = true;        d[s] = 1 - d[s];        ret++;        if (!vis[t])            cnt++;        int temp = unify(s + dir[d[t]]);        if (temp == t)            temp = unify(temp + dir[d[t]]);        s = t;        t = temp;    }     printf("Classmate %d got the ball last after %d tosses.\n", s + 1, ret);} int main(){    while (scanf("%d", &n), n)    {        input();        work();    }    return 0;}
                                                                                                                                                  ^
0_0_20610525_5506.cpp:5:181: error: 'n' was not declared in this scope
     using namespace std; #define maxn 35 int n, m;int d[maxn];int dir[2] = {-1, 1};bool vis[maxn]; void input(){    char st[5];     scanf("%d", &m);    m--;    for (int i = 0; i < n; i++)    {        scanf("%s", st);        if (st[0] == 'R')            d[i] = 1;        else            d[i] = 0;    }} int unify(int a){    return (a + n) % n;} void work(){    int s = m;    int t = unify(0 + dir[d[m]]);    if (t == m)        t = unify(t + dir[d[m]]);    int cnt = 1;    int ret = 1;     vis[m] = true;    memset(vis, 0, sizeof(vis));    while (cnt < n)    {        vis[s] = true;        d[s] = 1 - d[s];        ret++;        if (!vis[t])            cnt++;        int temp = unify(s + dir[d[t]]);        if (temp == t)            temp = unify(temp + dir[d[t]]);        s = t;        t = temp;    }     printf("Classmate %d got the ball last after %d tosses.\n", s + 1, ret);} int main(){    while (scanf("%d", &n), n)    {        input();        work();    }    return 0;}
                                                                                                                                                                                     ^
0_0_20610525_5506.cpp:5:254: error: 'd' was not declared in this scope
     using namespace std; #define maxn 35 int n, m;int d[maxn];int dir[2] = {-1, 1};bool vis[maxn]; void input(){    char st[5];     scanf("%d", &m);    m--;    for (int i = 0; i < n; i++)    {        scanf("%s", st);        if (st[0] == 'R')            d[i] = 1;        else            d[i] = 0;    }} int unify(int a){    return (a + n) % n;} void work(){    int s = m;    int t = unify(0 + dir[d[m]]);    if (t == m)        t = unify(t + dir[d[m]]);    int cnt = 1;    int ret = 1;     vis[m] = true;    memset(vis, 0, sizeof(vis));    while (cnt < n)    {        vis[s] = true;        d[s] = 1 - d[s];        ret++;        if (!vis[t])            cnt++;        int temp = unify(s + dir[d[t]]);        if (temp == t)            temp = unify(temp + dir[d[t]]);        s = t;        t = temp;    }     printf("Classmate %d got the ball last after %d tosses.\n", s + 1, ret);} int main(){    while (scanf("%d", &n), n)    {        input();        work();    }    return 0;}
                                                                                                                                                                                                                                                              ^
0_0_20610525_5506.cpp:5:287: error: 'd' was not declared in this scope
     using namespace std; #define maxn 35 int n, m;int d[maxn];int dir[2] = {-1, 1};bool vis[maxn]; void input(){    char st[5];     scanf("%d", &m);    m--;    for (int i = 0; i < n; i++)    {        scanf("%s", st);        if (st[0] == 'R')            d[i] = 1;        else            d[i] = 0;    }} int unify(int a){    return (a + n) % n;} void work(){    int s = m;    int t = unify(0 + dir[d[m]]);    if (t == m)        t = unify(t + dir[d[m]]);    int cnt = 1;    int ret = 1;     vis[m] = true;    memset(vis, 0, sizeof(vis));    while (cnt < n)    {        vis[s] = true;        d[s] = 1 - d[s];        ret++;        if (!vis[t])            cnt++;        int temp = unify(s + dir[d[t]]);        if (temp == t)            temp = unify(temp + dir[d[t]]);        s = t;        t = temp;    }     printf("Classmate %d got the ball last after %d tosses.\n", s + 1, ret);} int main(){    while (scanf("%d", &n), n)    {        input();        work();    }    return 0;}
                                                                                                                                                                                                                                                                                               ^
0_0_20610525_5506.cpp: In function 'int unify(int)':
0_0_20610525_5506.cpp:5:336: error: 'n' was not declared in this scope
     using namespace std; #define maxn 35 int n, m;int d[maxn];int dir[2] = {-1, 1};bool vis[maxn]; void input(){    char st[5];     scanf("%d", &m);    m--;    for (int i = 0; i < n; i++)    {        scanf("%s", st);        if (st[0] == 'R')            d[i] = 1;        else            d[i] = 0;    }} int unify(int a){    return (a + n) % n;} void work(){    int s = m;    int t = unify(0 + dir[d[m]]);    if (t == m)        t = unify(t + dir[d[m]]);    int cnt = 1;    int ret = 1;     vis[m] = true;    memset(vis, 0


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 18:14:45, Gzip enabled