ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1114. Boxes

WHY WA ON TEST #7
Posted by michel mizrahi 8 Apr 2005 08:05
Maybe I need to use bignum but I am not sure if it is really necesary to use bignum or not...maybe my code has another error

here is my code:

#include <stdio.h>
long long cmb[100][100],res;

c(n,k){
    int i,j;
    for(i=0;i<=n;i++){
      cmb[i][0]=1;
      cmb[i][i]=1;
    }
    for(i=1;i<=n;i++)
        for(j=1;j<=k;j++)
          cmb[i][j]=cmb[i-1][j-1] + cmb[i-1][j];
     return cmb[n][k];
}

int main(){
  int n,a,b;
  scanf("%d %d %d",&n,&a,&b);
  res=c(n+a,a)*c(n+b,b);
  printf("%I64d\n",res);
  return 0;
}


thanks for reading
bye