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_20614393_28305.cpp:7:5: error: expected unqualified-id before numeric constant
     0){        c=a/b;        d=a; a=b; b=d%b;        d=p; p=q; q=d-c*q;    }    return p<0?p+m:p;} int main(){    mod[0]=1;    ny[0]=for_ny(mod[0],MOD);    for(int i=1;i<N;i++){        mod[i]=(mod[i-1]*i)%MOD;        ny[i]=(LL)for_ny((int)mod[i],(int)MOD);    }    while(scanf("%d",&n)!=EOF){        getchar();        scanf("%s",str);        if(n%2){            puts("0");            continue;        }        int len=strlen(str);        int p=0,q=0,i;        for(i=0;i<len;i++){            if(str[i]=='(') p++;            if(str[i]==')') q++;            if(q>p) break;        }        if(i<len){            puts("0");            continue;        }        n/=2;        q=n-q,p=n-p;        if(q<0||p<0){            puts("0");            continue;        }        int m=p+q;        LL ans=(C(m,q)-C(m,q+1)+MOD)%MOD;        printf("%I64d\n",ans);    }    return 0;}
     ^
0_0_20614393_28305.cpp:7:81: error: expected unqualified-id before 'return'
     0){        c=a/b;        d=a; a=b; b=d%b;        d=p; p=q; q=d-c*q;    }    return p<0?p+m:p;} int main(){    mod[0]=1;    ny[0]=for_ny(mod[0],MOD);    for(int i=1;i<N;i++){        mod[i]=(mod[i-1]*i)%MOD;        ny[i]=(LL)for_ny((int)mod[i],(int)MOD);    }    while(scanf("%d",&n)!=EOF){        getchar();        scanf("%s",str);        if(n%2){            puts("0");            continue;        }        int len=strlen(str);        int p=0,q=0,i;        for(i=0;i<len;i++){            if(str[i]=='(') p++;            if(str[i]==')') q++;            if(q>p) break;        }        if(i<len){            puts("0");            continue;        }        n/=2;        q=n-q,p=n-p;        if(q<0||p<0){            puts("0");            continue;        }        int m=p+q;        LL ans=(C(m,q)-C(m,q+1)+MOD)%MOD;        printf("%I64d\n",ans);    }    return 0;}
                                                                                 ^
0_0_20614393_28305.cpp:7:98: error: expected declaration before '}' token
     0){        c=a/b;        d=a; a=b; b=d%b;        d=p; p=q; q=d-c*q;    }    return p<0?p+m:p;} int main(){    mod[0]=1;    ny[0]=for_ny(mod[0],MOD);    for(int i=1;i<N;i++){        mod[i]=(mod[i-1]*i)%MOD;        ny[i]=(LL)for_ny((int)mod[i],(int)MOD);    }    while(scanf("%d",&n)!=EOF){        getchar();        scanf("%s",str);        if(n%2){            puts("0");            continue;        }        int len=strlen(str);        int p=0,q=0,i;        for(i=0;i<len;i++){            if(str[i]=='(') p++;            if(str[i]==')') q++;            if(q>p) break;        }        if(i<len){            puts("0");            continue;        }        n/=2;        q=n-q,p=n-p;        if(q<0||p<0){            puts("0");            continue;        }        int m=p+q;        LL ans=(C(m,q)-C(m,q+1)+MOD)%MOD;        printf("%I64d\n",ans);    }    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-27 06:04:49, Gzip enabled