样例输入
3 3
样例输出
10
#include<iostream>
using namespace std;
typedef long long ll;
const int mod = 998244353;
const int N = 6500;
int C[N][N];
void init()
{
for(int i=0; i<N; i++)
{
for(int j=0; j<=i; j++)
{
if(!j)
C[i][j] = 1;
else
C[i][j] = (C[i-1][j] + C[i-1][j-1]) % mod;
}
}
}
int main()
{
init();
int n, m;
scanf("%d%d", &n, &m);
printf("%d\n", C[n+m-1][m-1]);
return 0;
}
看了zgh大佬的博客之后才发现原来是个组合问题,,,,tql
题目来源
nuc-2019新生赛
另外贴一下思路来源:
https://blog.csdn.net/weixin_43888745/article/details/103343149