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_20612954_921.cpp: In function 'int main()':
0_0_20612954_921.cpp:3:237: error: 'memset' was not declared in this scope
      const int MOD = 987654321; long long dp[110][10]; int main(){    int n,m;    while(scanf("%d%d",&n,&m),n>0)    {        if(m==1){puts("0");continue;}        if(m==2){printf("%d\n",n==1?2:0);continue;}         memset(dp,0,sizeof(dp));        dp[1][1]=m;        for(int i=1;i<=n;i++)        {            for(int j=1;j<m;j++)            {                dp[i][j]%=MOD;                 dp[i+1][j+1]+=dp[i][j]*(m-j);                for(int k=2;k<=j;k++)                    dp[i+1][k]+=dp[i][j];                 if(j>1||i==1)                {                    for(int k=1;1+k<=m-1;k++)                    {                        dp[i+k][1]+=dp[i][j];                    }                }            }        }         long long ans=0;        for(int j=1;j<m;j++)        {            ans+=dp[n][j];        }        printf("%I64d\n",ans%MOD);    }    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-17 06:32:35, Gzip enabled