标签:size title scanf ems ble des 包括 sizeof 计数
http://acm.hdu.edu.cn/showproblem.php?pid=2151
#include <bits/stdc++.h>
using namespace std;
int dp[101][101];
int main() {
int n, m, p, t;
while(~scanf("%d%d%d%d", &n, &p, &m, &t)) {
memset(dp, 0, sizeof(dp));
dp[0][p] = 1;
for(int i = 1; i <= m; i ++) {
for(int j = 1; j <= n; j ++) {
if(dp[i - 1][j - 1] != 0 || dp[i - 1][j + 1] != 0)
dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j + 1];
}
}
printf("%d\n", dp[m][t]);
}
return 0;
}
标签:size title scanf ems ble des 包括 sizeof 计数
原文地址:https://www.cnblogs.com/zlrrrr/p/9713678.html