delete pics to save space
This commit is contained in:
22
history_source/ccf 基础篇/U1/1.6.4.cpp
Normal file
22
history_source/ccf 基础篇/U1/1.6.4.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include<cstdio>
|
||||
using namespace std;
|
||||
int answer(int a,int b,int x)
|
||||
{
|
||||
if(b==1) return 1;
|
||||
int ans=0;
|
||||
for(int i=x;i*b<=a;i++) ans+=answer(a-i,b-1,i);
|
||||
return ans;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
int t;
|
||||
scanf("%d",&t);
|
||||
int a,b,ans[t];
|
||||
for(int i=0;i<t;i++)
|
||||
{
|
||||
scanf("%d%d",&a,&b);
|
||||
ans[i]=answer(a,b,0);
|
||||
}
|
||||
for(int i=0;i<t;i++) printf("%d\n",ans[i]);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user