标签:
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3322 Accepted Submission(s):
1235
#include<stdio.h> #include<string.h> #define MAX 2100 int a[MAX][MAX]; int main() { int n,m,j,i,s,sum,t; for(i=1;i<MAX;i++) { a[1][i]=0; a[i][1]=i%1007; } for(i=2;i<MAX;i++) { for(j=2;j<MAX;j++) { a[i][j]=(a[i-1][j-1]%1007+a[i-1][j]%1007)%1007; } } scanf("%d",&t); while(t--) { scanf("%d%d",&m,&n); printf("%d\n",a[n][m]); } return 0; }
标签:
原文地址:http://www.cnblogs.com/tonghao/p/4551770.html