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_20612907_8020.cpp:4:6: error: expected unqualified-id before numeric constant
      1)            return 1;        else            return 0;    }    if (mark[l][r]>= 0)        return mark[l][r];    char ch = cha[l];    for (i = l + 1; i <= r; i++){        if (cha[i] == ch){            if (mark[l + 1][i - 1] = dfs(l + 1, i - 1)){                t = mark[i][r];                mark[i][r] = -1;                num[i] += num[l];                mark[i][r] = dfs(i, r);                num[i] -= num[l];                if (mark[i][r] == 1)                {                    mark[i][r] = t;                    return 1;                }                mark[i][r] = t;            }        }    }    if (num[l] > 1 && (mark[l + 1][r] = dfs(l + 1, r)))        return 1;    return 0;}int main(){    int len, time, index, i;    while (scanf("%s", str) != EOF){        len = strlen(str);        if (len == 0){            puts("solvable");            continue;        }        time = 1;        index = 0;        for (i = 1; i <= len; i++){            if (str[i] != str[i - 1]){                cha[index] = str[i - 1];                num[index] = time;                time = 1;                index++;            }            else                time++;        }            memset(mark, -1, sizeof(mark));        if (dfs(0, index - 1))            puts("solvable");        else            puts("unsolvable");    }    return 0;}
      ^
0_0_20612907_8020.cpp:4:37: error: expected unqualified-id before 'else'
      1)            return 1;        else            return 0;    }    if (mark[l][r]>= 0)        return mark[l][r];    char ch = cha[l];    for (i = l + 1; i <= r; i++){        if (cha[i] == ch){            if (mark[l + 1][i - 1] = dfs(l + 1, i - 1)){                t = mark[i][r];                mark[i][r] = -1;                num[i] += num[l];                mark[i][r] = dfs(i, r);                num[i] -= num[l];                if (mark[i][r] == 1)                {                    mark[i][r] = t;                    return 1;                }                mark[i][r] = t;            }        }    }    if (num[l] > 1 && (mark[l + 1][r] = dfs(l + 1, r)))        return 1;    return 0;}int main(){    int len, time, index, i;    while (scanf("%s", str) != EOF){        len = strlen(str);        if (len == 0){            puts("solvable");            continue;        }        time = 1;        index = 0;        for (i = 1; i <= len; i++){            if (str[i] != str[i - 1]){                cha[index] = str[i - 1];                num[index] = time;                time = 1;                index++;            }            else                time++;        }            memset(mark, -1, sizeof(mark));        if (dfs(0, index - 1))            puts("solvable");        else            puts("unsolvable");    }    return 0;}
                                     ^
0_0_20612907_8020.cpp:4:66: error: expected declaration before '}' token
      1)            return 1;        else            return 0;    }    if (mark[l][r]>= 0)        return mark[l][r];    char ch = cha[l];    for (i = l + 1; i <= r; i++){        if (cha[i] == ch){            if (mark[l + 1][i - 1] = dfs(l + 1, i - 1)){                t = mark[i][r];                mark[i][r] = -1;                num[i] += num[l];                mark[i][r] = dfs(i, r);                num[i] -= num[l];                if (mark[i][r] == 1)                {                    mark[i][r] = t;                    return 1;                }                mark[i][r] = t;            }        }    }    if (num[l] > 1 && (mark[l + 1][r] = dfs(l + 1, r)))        return 1;    return 0;}int main(){    int len, time, index, i;    while (scanf("%s", str) != EOF){        len = strlen(str);        if (len == 0){            puts("solvable");            continue;        }        time = 1;        index = 0;        for (i = 1; i <= len; i++){            if (str[i] != str[i - 1]){                cha[index] = str[i - 1];                num[index] = time;                time = 1;                index++;            }            else                time++;        }            memset(mark, -1, sizeof(mark));        if (dfs(0, index - 1))            puts("solvable");        else            puts("unsolvable");    }    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-11-23 05:38:07, Gzip enabled