| 比赛 | 搜索题... | 评测结果 | AAAAAAAAAA | 
    | 题目名称 | 跳马问题 | 最终得分 | 100 | 
    | 用户昵称 | 窝 | 运行时间 | 0.003 s | 
    | 代码语言 | C++ | 内存使用 | 0.32 MiB | 
    | 提交时间 | 2014-11-04 17:34:00 | 
显示代码纯文本
#include<iostream>
#include<cstdio>
using namespace std;
int f[25][25];
int main()
{
	freopen("horse.in","r",stdin);
	freopen("horse.out","w",stdout);
	//int  x[4]={2,1,-1,-2},
     //    y[4]={1,2,2,1};
	int m,n;
	cin>>m>>n;
	f[2][2]=1;
	for(int i=2;i<=n+1;i++)
	 for(int j=2;j<=m+1;j++)
	 {
	 	//f[i][j]+=f[i-2][j-1]+f[i-1][j-2]+f[i+1][j-2]+f[i+2][j-1];
	 	f[i][j]+=f[i-2][j-1]+f[i-2][j+1]+f[i-1][j-2]+f[i-1][j+2];
	}
	 cout<<f[n+1][m+1];
	 return 0;
}