- 马拦过河卒
- 2016-11-13 20:33:06 @
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
__int64 f[20][20]={0};
int main(){
int n,m;
int x,y;
scanf("%d %d %d %d",&n,&m,&x,&y);
for(int i=0;i<=n;i++)
f[i][0]=1;
for(int j=0;j<=m;j++)
f[0][j]=1;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
f[i][j]=f[i][j-1]+f[i-1][j];
if((i==x&&j==y)||(i==(x-1)&&j==(y+2))||(i==(x+2)&&j==(y+1))||(i==(x+1)&&j==(y+2))||(i==(x+1)&&j==(y-2))||(i==(x-1)&&j==(y-2))||(i==(x-2)&&j==(y-1))||(i==(x-2)&&j==(y+1))||(i==(x+2)&&j==(y-1))) f[i][j]=0;
}
}
printf("%I64d",f[n][m]);
return 0;
}
0 条评论
目前还没有评论...