Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

是我没看懂?还是怎么回事。。?

Posted by Muye007 at 2013-10-15 01:58:05 on Problem 2346 and last updated at 2013-10-15 01:58:26
In Reply To:此题DP做法 Posted by:FOXLIU at 2008-09-21 01:00:16
#include <stdio.h>
int num(int x,int y)
{
    if(y==0) return 1;
    else if(x==1&&y>=0&&y<=9) return 1;
    else if(y>=10) return num(x-1,y)+num(x,y-1)-num(x-1,y-10);
    else return num(x-1,y)+num(x,y-1);
}
int main()
{
    int n,i,j,sum=0;
    scanf("%d",&n);
    i=n/2;
    for(j=0;j<=9*i;j++)
        sum+=num(i,j)*num(i,j);
    printf("%d\n",sum);
    return 0;
}

数据严重出错啊= =

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator