Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
本题是很简单的递推本题是很简单的递推。 ①最少的盘子放了一个,这样每个盘子至少一个,n个盘子先放上n个,剩下的m-n个可以随便放 ②最少的盘子没有放,这样剩下的n-1个盘子还是随便放m个 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator