标签:
Description
Input
Output
Sample Input
Sample Output
1 #include<iostream> 2 using namespace std; 3 const int maxn=2000+20; 4 int p[maxn][maxn]; 5 void set() 6 { 7 for(int i=1;i<=2000;i++) 8 p[1][i]=i%1007,p[i][i]=1; 9 10 for(int i=2;i<=2000;i++) 11 for(int j=i+1;j<=2000;j++) 12 p[i][j]=(p[i-1][j-1]+p[i][j-1])%1007; 13 } 14 int main() 15 { 16 int n,m,T; 17 set(); 18 cin>>T; 19 while(T--) 20 { 21 cin>>m>>n; 22 cout<<p[m][n]<<endl; 23 } 24 return 0; 25 }
标签:
原文地址:http://www.cnblogs.com/huaxiangdehenji/p/4696538.html