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_20614394_7654.cpp:5:5: error: 'b' does not name a type
     b?a:b int dp[320][50005]; int main(){    int T;    while(scanf("%d",&T)!=EOF){        for(int q=1;q<=T;q++){            int n,mod,ans=0;            scanf("%d%d",&n,&mod);            memset(dp,0,sizeof(dp));            int m=(sqrt(8.0*n+1)-1)/2;            int i,j;            dp[0][0]=1;            for(i=1;i<=m;i++){                for(j=0;j<=n;j++){                    if(i>j)dp[i][j]=0;                    else dp[i][j]=(dp[i-1][j-i]+dp[i][j-i])%mod;                    if(j==n)ans=(ans+dp[i][j])%mod;                }            }            printf("Case #%d: %d\n",q,ans);        }    }    return 0;}
     ^
0_0_20614394_7654.cpp: In function 'int main()':
0_0_20614394_7654.cpp:5:194: error: 'dp' was not declared in this scope
     b?a:b int dp[320][50005]; int main(){    int T;    while(scanf("%d",&T)!=EOF){        for(int q=1;q<=T;q++){            int n,mod,ans=0;            scanf("%d%d",&n,&mod);            memset(dp,0,sizeof(dp));            int m=(sqrt(8.0*n+1)-1)/2;            int i,j;            dp[0][0]=1;            for(i=1;i<=m;i++){                for(j=0;j<=n;j++){                    if(i>j)dp[i][j]=0;                    else dp[i][j]=(dp[i-1][j-i]+dp[i][j-i])%mod;                    if(j==n)ans=(ans+dp[i][j])%mod;                }            }            printf("Case #%d: %d\n",q,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-12-25 01:37:25, Gzip enabled