标签:
Tyvj 1008 传球游戏
3 3
2
1 #include<iostream> 2 using namespace std; 3 int main(){ 4 int n,m,dp[100][100]; 5 cin>>n>>m; 6 dp[1][0] = dp[1+n][0] = 1; 7 for(int j = 1;j <= m;j++){ 8 for(int i = 1;i <= n;i++){ 9 if(i > 1) dp[i][j] = dp[i+n][j] = dp[i-1][j-1] + dp[i+1][j-1]; 10 else dp[i][j] = dp[i+n][j] = dp[2*n][j-1] + dp[i+1][j-1]; 11 } 12 } 13 cout<<dp[1][m]<<endl; 14 return 0; 15 }
标签:
原文地址:http://www.cnblogs.com/hyfer/p/4841047.html