标签:
原题
Description
Input
Output
Sample Input
Sample Output
#include<iostream> #include<cstdio> using namespace std; int ch[2500][2500]; int main() { int i, j; for (i = 1; i <= 2000; i++) { ch[i][i] = 1; ch[i][1] = i % 1007; } for (i = 2; i <= 2000; i++) for (j = 2; j <= i; j++) ch[i][j] = (ch[i - 1][j] % 1007 + ch[i - 1][j - 1] % 1007) % 1007; int t; cin >> t; while (t--) { int m, n; scanf("%d%d", &m, &n); cout << ch[n][m] << endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/shawn-ji/p/4696562.html