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

who can tell me why i got WA?? Thanks.
Posted by 55555 1 Aug 2003 14:49
#include <stdio.h>

void main()
{
    int n,a,b,i,j;
    double c=1;
    double p[36];

    scanf("%d %d %d",&n,&a,&b);

      if(a>b)
    {
        i=a; a=b; b=i;
    }
    for(i=0;i<36;i++) p[i]=1;
      for(i=1;i<=n+b;i++)
    {
            for(j=i;j>1;j--)
                p[j]=p[j]+p[j-1];
            if(i==n+a) c=p[a+1];
      }
    printf("%.0lf",c*p[b+1]);
}