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:1<=M,N<=10。请问测试数据里有没有M个苹果0个盘子的?这样应该输出多少啊?这个哇了。

Posted by neikeda_hewei at 2009-05-05 21:39:50 on Problem 1664
In Reply To:1<=M,N<=10。请问测试数据里有没有M个苹果0个盘子的?这样应该输出多少啊?这个哇了。 Posted by:neikeda_hewei at 2009-05-05 21:37:59
> #include<iostream>
> using namespace std;
> 
> int f(int m,int n);
> int main()
> {
> 	int M,N,K;
> 	
> 	cin>>M>>N;
> 	K=f(M,N);
>     cout<<K<<endl;
> 	return 0;
> }
> int f(int M,int N)
> {
> 	if(M<0)
>    return 0;
>   if(M==0||N==1)
> 	  return 1;
>   return f(M-N,N)+f(M,N-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