求助,为什么会运行错误?
  • 板块学术版
  • 楼主Lucass
  • 当前回复11
  • 已保存回复11
  • 发布时间2020/7/11 11:34
  • 上次更新2023/11/6 23:18:10
查看原帖
求助,为什么会运行错误?
358578
Lucass楼主2020/7/11 11:34
#include<bits/stdc++.h>
using namespace std;
int n,m,nn,a[10001][10001];
int cxk(int x,int y)
{
    for(int i=0;i<=x;i++)a[i][0]=1;
    for(int i=1;i<=x;i++)
    for(int j=1;j<=y&&j<=i;j++)
    a[i][j]=(a[i-1][j]+a[i-1][j-1])%998244353;
    return a[x][y];
} 
int main()
{
	cin>>nn;
	while(nn--)
	{
		cin>>n>>m;
		cout<<cxk(n,m)<<endl;
	}
	return 0;
}
2020/7/11 11:34
加载中...