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

Re:用递归做的,,但是超时,,,,,:)

Posted by deep_you at 2005-02-27 22:09:48 on Problem 1243
In Reply To:用递归做的,,但是超时,,,,,:) Posted by:deep_you at 2005-02-27 17:17:33
> #include <stdio.h>
> 
> int work(int m,int n)
> {
>  if(n==0)return(m);
>  if(m==1)return(1);
>  return(1+work(m-1,n-1)+work(m-1,n));
> }
> 
> void main()
> {
>  int m,n,no=1;
> 
>  do
>  {
>   scanf("%d%d",&m,&n);
>   if(m==0&&n==0)break;
>   printf("Case %d: %d\n",no,work(m,n));
>   no++;
>  }
>  while(1);
> }

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