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_13469577_2952.cpp: In function 'bool judge(int, int)':
0_0_13469577_2952.cpp:2:97: error: 'str' was not declared in this scope
 bool judge(int x, int y) {    int i, k = (y - x + 1) / 2;    for (i = 0; i < k; i++)        if (str[x + i] != str[y - i])return false;    return true;}
                                                                                                 ^
0_0_13469577_2952.cpp: In function 'int main()':
0_0_13469577_2952.cpp:3:23: error: 'M' was not declared in this scope
 int main() {    int f[M], n, i, j;    while (scanf("%s", str) != EOF) {        n = strlen(str);        for (i = 0; i < n; i++)            for (j = i; j < n; j++) {                if (judge(i, j))map[i][j] = 1;                else map[i][j] = 0;            }        f[0] = 0;        for (i = 1; i < n; i++) {            f[i] = oo;            if (map[0][i])f[i] = 0;            else {                for (j = 0; j < i; j++)                    if (map[j + 1][i] && f[j] + 1 < f[i])                        f[i] = f[j] + 1;            }        }        printf("%d\n", f[n - 1]);    }    return 0;}
                       ^
0_0_13469577_2952.cpp:3:58: error: 'str' was not declared in this scope
 int main() {    int f[M], n, i, j;    while (scanf("%s", str) != EOF) {        n = strlen(str);        for (i = 0; i < n; i++)            for (j = i; j < n; j++) {                if (judge(i, j))map[i][j] = 1;                else map[i][j] = 0;            }        f[0] = 0;        for (i = 1; i < n; i++) {            f[i] = oo;            if (map[0][i])f[i] = 0;            else {                for (j = 0; j < i; j++)                    if (map[j + 1][i] && f[j] + 1 < f[i])                        f[i] = f[j] + 1;            }        }        printf("%d\n", f[n - 1]);    }    return 0;}
                                                          ^
0_0_13469577_2952.cpp:3:94: error: 'strlen' was not declared in this scope
 int main() {    int f[M], n, i, j;    while (scanf("%s", str) != EOF) {        n = strlen(str);        for (i = 0; i < n; i++)            for (j = i; j < n; j++) {                if (judge(i, j))map[i][j] = 1;                else map[i][j] = 0;            }        f[0] = 0;        for (i = 1; i < n; i++) {            f[i] = oo;            if (map[0][i])f[i] = 0;            else {                for (j = 0; j < i; j++)                    if (map[j + 1][i] && f[j] + 1 < f[i])                        f[i] = f[j] + 1;            }        }        printf("%d\n", f[n - 1]);    }    return 0;}
                                                                                              ^
0_0_13469577_2952.cpp:3:196: error: 'map' was not declared in this scope
 int main() {    int f[M], n, i, j;    while (scanf("%s", str) != EOF) {        n = strlen(str);        for (i = 0; i < n; i++)            for (j = i; j < n; j++) {                if (judge(i, j))map[i][j] = 1;                else map[i][j] = 0;            }        f[0] = 0;        for (i = 1; i < n; i++) {            f[i] = oo;            if (map[0][i])f[i] = 0;            else {                for (j = 0; j < i; j++)                    if (map[j + 1][i] && f[j] + 1 < f[i])                        f[i] = f[j] + 1;            }        }        printf("%d\n", f[n - 1]);    }    return 0;}
                                                                                                                                                                                                    ^
0_0_13469577_2952.cpp:3:231: error: 'map' was not declared in this scope
 int main() {    int f[M], n, i, j;    while (scanf("%s", str) != EOF) {        n = strlen(str);        for (i = 0; i < n; i++)            for (j = i; j < n; j++) {                if (judge(i, j))map[i][j] = 1;                else map[i][j] = 0;            }        f[0] = 0;        for (i = 1; i < n; i++) {            f[i] = oo;            if (map[0][i])f[i] = 0;            else {                for (j = 0; j < i; j++)                    if (map[j + 1][i] && f[j] + 1 < f[i])                        f[i] = f[j] + 1;            }        }        printf("%d\n", f[n - 1]);    }    return 0;}
                                                                                                                                                                                                                                       ^
0_0_13469577_2952.cpp:3:266: error: 'f' was not declared in this scope
 int main() {    int f[M], n, i, j;    while (scanf("%s", str) != EOF) {        n = strlen(str);        for (i = 0; i < n; i++)            for (j = i; j < n; j++) {                if (judge(i, j))map[i][j] = 1;                else map[i][j] = 0;            }        f[0] = 0;        for (i = 1; i < n; i++) {            f[i] = oo;            if (map[0][i])f[i] = 0;            else {                for (j = 0; j < i; j++)                    if (map[j + 1][i] && f[j] + 1 < f[i])                        f[i] = f[j] + 1;            }        }        printf("%d\n", f[n - 1]);    }    return 0;}
                                                                                                                                                                                                                                                                          ^
0_0_13469577_2952.cpp:3:327: error: 'oo' was not declared in this scope
 int main() {    int f[M], n, i, j;    while (scanf("%s", str) != EOF) {        n = strlen(str);        for (i = 0; i < n; i++)            for (j = i; j < n; j++) {                if (judge(i, j))map[i][j] = 1;                else map[i][j] = 0;            }        f[0] = 0;        for (i = 1; i < n; i++) {            f[i] = oo;            if (map[0][i])f[i] = 0;            else {                for (j = 0; j < i; j++)                    if (map[j + 1][i] && f[j] + 1 < f[i])                        f[i] = f[j] + 1;            }        }        printf("%d\n", f[n - 1]);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                       ^
0_0_13469577_2952.cpp:3:346: error: 'map' was not declared in this scope
 int main() {    int f[M], n, i, j;    while (scanf("%s", str) != EOF) {        n = strlen(str);        for (i = 0; i < n; i++)            for (j = i; j < n; j++) {                if (judge(i, j))map[i][j] = 1;                else map[i][j] = 0;            }        f[0] = 0;        for (i = 1; i < n; i++) {            f[i] = oo;            if (map[0][i])f[i] = 0;            else {                for (j = 0; j < i; j++)                    if (map[j + 1][i] && f[j] + 1 < f[i])                        f[i] = f[j] + 1;            }        }        printf("%d\n", f[n - 1]);    }    return 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-12-05 10:25:00, Gzip enabled