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 |
Re:发个清晰明了的acIn Reply To:发个清晰明了的ac Posted by:l331258747 at 2011-08-06 09:53:08 #include<iostream> using namespace std; int split(int n,int m){ if(n==0||m==0) return 0; if(n==1||m==1) return 1; if(n<m) return split(n,n); if(n==m) return (split(n,m-1)+1); return split(n,m-1)+split(n-m,m); } int main(){ int n,m,a; cin>>a; while(a--){ cin>>n>>m; split(n,m); cout<<split(n,m)<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator