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_20613690_29906.cpp:12:5: error: expected unqualified-id before '=' token
     =mod) C[i][j]-=mod;        }    }}ll f(int n,int d){    if(n==1&&d>=1) return 1;    if(n==1||d==0) return 0;    if(dp[n][d]!=-1) return dp[n][d];    ll &ans=dp[n][d];    ans=0;    ans=(ans+f(n-1,d-1)*n*2)%mod;    for(int k=1;k<=n-2;++k)        ans=(ans+(f(k,d-1)*f(n-k-1,d-1)%mod*C[n-2][k]%mod)*n)%mod;    return ans;}int main(){    Init();    memset(dp,0xff,sizeof(dp));    int t,tcase=0,n,d;    scanf("%d",&t);    while(t--)    {        scanf("%d%d",&n,&d);        ll ans=f(n,d)-f(n,d-1);        ans=(ans+mod)%mod;        printf("Case #%d: %I64d\n",++tcase,ans);    }    return 0;}
     ^
0_0_20613690_29906.cpp:12:32: error: expected declaration before '}' token
     =mod) C[i][j]-=mod;        }    }}ll f(int n,int d){    if(n==1&&d>=1) return 1;    if(n==1||d==0) return 0;    if(dp[n][d]!=-1) return dp[n][d];    ll &ans=dp[n][d];    ans=0;    ans=(ans+f(n-1,d-1)*n*2)%mod;    for(int k=1;k<=n-2;++k)        ans=(ans+(f(k,d-1)*f(n-k-1,d-1)%mod*C[n-2][k]%mod)*n)%mod;    return ans;}int main(){    Init();    memset(dp,0xff,sizeof(dp));    int t,tcase=0,n,d;    scanf("%d",&t);    while(t--)    {        scanf("%d%d",&n,&d);        ll ans=f(n,d)-f(n,d-1);        ans=(ans+mod)%mod;        printf("Case #%d: %I64d\n",++tcase,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-26 23:53:36, Gzip enabled