标签:des style blog color java os io strong
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1356 Accepted Submission(s): 890
1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #include <vector> 5 #include <queue> 6 #include <stack> 7 #include <iostream> 8 using namespace std; 9 10 int a[2005][2005]; 11 12 void init(){ 13 int i, j; 14 a[1][1]=1; 15 for(i=2;i<=2001;i++){ 16 a[i][1]=a[i-1][i-1]; 17 for(j=2;j<=i;j++){ 18 a[i][j]=(a[i-1][j-1]+a[i][j-1])%1000; 19 } 20 } 21 } 22 23 main() 24 { 25 int n, t; 26 cin>>t; 27 init(); 28 /* for(int i=1;i<=10;i++){ 29 for(int j=1;j<=i;j++) printf("%d ",a[i][j]); 30 cout<<endl; 31 }*/ 32 while(t--){ 33 scanf("%d",&n); 34 printf("%d\n",a[n+1][1]); 35 } 36 }
标签:des style blog color java os io strong
原文地址:http://www.cnblogs.com/qq1012662902/p/3895592.html