Binomial Coeffcients 过去山东省省赛冠军

时间:2023-03-09 07:22:50
Binomial Coeffcients 过去山东省省赛冠军

Binomial Coeffcients

Time Limit: 1000MS Memory limit: 65536K

题目描写叙述

 Binomial Coeffcients 过去山东省省赛冠军

输入

 Binomial Coeffcients 过去山东省省赛冠军

输出

Binomial Coeffcients 过去山东省省赛冠军 

演示样例输入

3
1 1
10 2
954 723

演示样例输出

1
45
3557658
 
#include<iostream>
using namespace std;
#include <string.h> int a[1020][1020];
int main()
{
int n,m,i,j,k;
memset(a,0,sizeof(a));
a[0][0]=1;
for(i=1; i<=1000; i++)
{
a[i][0]=1;
for(j=1; j<=i; j++)
{
a[i][j]=a[i-1][j]+a[i-1][j-1];
if(a[i][j]>10000003)
a[i][j]=a[i][j]-10000003;
}
}
cin>>k;
while(k--)
{
cin>>n>>m;
cout<<a[n][m]<<endl;
}
return 0;
}






版权声明:本文博客原创文章,博客,未经同意,不得转载。