比赛 2026初中综合小练习 评测结果 TAAAAATTTT
题目名称 传球游戏 最终得分 50
用户昵称 Youth 运行时间 6.200 s
代码语言 C++ 内存使用 3.53 MiB
提交时间 2026-04-14 21:13:07
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
int n,m,dp[32][32];
int f(int x,int y){
    if(y==0)return (x==1?1:0);
    int xx=x;
    if(x<=1)xx=n+1;
    return dp[x][y]=f((x+1>n?1:x+1),y-1)+f(xx-1,y-1);
}
int main(){
    freopen("ballg.in","r",stdin);
    freopen("ballg.out","w",stdout);
    cin>>n>>m;
    cout<<f(1,m);
    return 0;
}