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:为什么会AC?????

Posted by qdj_dlut_faye at 2008-12-05 00:33:41 on Problem 1664
In Reply To:Re:为什么会AC????? Posted by:qdj_dlut_faye at 2008-12-05 00:24:24
if(m>=n)
return isItRight( m, n - 1 )+ isItRight( m - n, n );

当苹果数m大于或者等于盘子数n是,具体分法可以分如下两种情况讨论:
1、有的盘子为空,即分法总数为isItRight( m, n - 1 );
2、n个盘子都不为空。如何实现,就是先在每个盘子里都放1个苹果。剩下的(m-n)个苹果,就可以随意分,即分法总数为isItRight( m - n, n )

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