标签:
http://acm.hdu.edu.cn/showproblem.php?pid=2151
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3403 Accepted Submission(s): 2194
#include<stdio.h> #include<string.h> #define max(a,b) (a>b?a:b) #define N 1100 int dp[N][N]; int main() { int n, P, M, T; while(scanf("%d%d%d%d", &n, &P, &M, &T)!=EOF) { int i, j; memset(dp, 0, sizeof(dp)); dp[0][P] = 1; for(i=1; i<=M; i++) for(j=1; j<=n; j++) { dp[i][j] = dp[i-1][j-1] + dp[i-1][j+1]; } printf("%d\n", dp[M][T]); } return 0; }
标签:
原文地址:http://www.cnblogs.com/YY56/p/4964992.html