|
|
вернуться в форумWA#2 Послано Navid 11 ноя 2011 22:19 I don't know.I thought it's true. Recursive algrithm is true. c++: #include<iostream> using namespace std; int main() { int n,k; cin>>n>>k; long long int A[11][17]; for(int i=2;i<11;i++) A[0][i]=1; for(int i=2;i<11;i++) A[1][i]=i-1; for(int i=2;i<11;i++) for(int j=2;j<17;j++) { A[i][j]=(j-1)*(A[i-1][j]+A[i-2][j]); } cout<<A[n][k]; cin>>n; return 0; } Re: WA#2 Послано Navid 11 ноя 2011 22:22 I got Ac.Size of A was small. |
|
|