题解(100%对)
2024-07-14 09:42:23
发布于:浙江
139阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int t;
long long n,k;
long long hf(long long x,long long y){
if(x==0||y==1){
return 1;
}
if(y==0){
return 1;
}
if(x<y){
return hf(x,x);
}
return hf(x,y-1)+hf(x-y,y);
}
int main()
{
cin>>t;
for(int i=1;i<=t;i++){
cin>>n>>k;
cout<<hf(n,k)<<endl;
}
return 0;
}
全部评论 1
点个赞呗!
2024-07-14 来自 浙江
0
有帮助,赞一个