| 记录编号 | 137712 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 49.跳马问题 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.002 s | ||
| 提交时间 | 2014-11-05 07:16:49 | 内存使用 | 0.32 MiB | ||
#include<iostream>
#include<cstdio>
#include<queue>
using namespace std;
int f[30][30];
int n,m;
int main()
{
freopen("horse.in","r",stdin);
freopen("horse.out","w",stdout);
cin>>n>>m;
f[2][2]=1;
for(int j=2;j<=m+1;j++)
{
for(int i=2;i<=n+1;i++)
{
f[i][j]+=f[i-2][j-1]+f[i-1][j-2]+f[i+2][j-1]+f[i+1][j-2];
}
}
cout<<f[n+1][m+1];
}