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 |
为什么会AC?????int isItRight(int m,int n) { if ( m <= 1|| n <= 1) return 1; if ( m < n ) return isItRight( m, m ); else return isItRight( m, n - 1 )+ isItRight( m - n, n ); } return isItRight( m, n - 1 )+ isItRight( m - n, n ); 中的isItRight( m,n - 1 )应该指的是小于n堆的总数, 可是isItRight( m - n, n )指的是什么呀, 难道是 m个苹果被分为n堆(不包括小于n堆的) 等于 先在n个箱子中各放一个, 然后再把剩下的苹果分为小于或等于n堆 ????????????????? 是这样吗? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator