- 马拦过河卒
- 2017-08-11 15:56:50 @
#include<cstdio>
#include<string.h>
using namespace std;
long long dp[22][22],x[22][22];
int a,b,n,m,i,j;
int main()
{
scanf("%d%d%d%d",&n,&m,&a,&b);
memset(dp,0,sizeof(dp));
x[a][b]=1;
x[a-2][b+1]=1;
x[a-2][b-1]=1;
x[a+2][b+1]=1;
x[a+2][b-1]=1;
x[a-1][b+2]=1;
x[a-1][b-2]=1;
x[a+1][b+2]=1;
x[a+1][b-2]=1;
for (i=0;i<=n;++i)
{
dp[i][0]=1;
for (j=1;j<=m;++j)
{
if (x[i][j]) dp[i][j]=0;
else dp[i][j]=dp[i-1][j]+dp[i][j-1];
}
}
printf("%lld",dp[n][m]);
return 0;
}
1 条评论
-
sign LV 4 @ 2017-08-20 22:59:15
我也是的
- 1