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 |
这题很神奇,呜呜,这不水吧#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator