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 TSERROF at 2012-11-22 23:24:20 on Problem 1664
#include<iostream>
using namespace std;
int f(int m,int n)
{
	if(n==1 || m<=1)return 1;
	if(m<n)return f(m,m);
	return f(m,n-1)+f(m-n,n);
}
int main()
{
	int t,m,n;
	cin>>t;
	while(t--)
	{
		cin>>m>>n;
		cout<<f(m,n)<<endl;
	}
	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