| 比赛 | 搜索题... | 评测结果 | WWWWWWWWWA |
|---|---|---|---|
| 题目名称 | 跳马问题 | 最终得分 | 10 |
| 用户昵称 | 好啊好啊 | 运行时间 | 0.014 s |
| 代码语言 | C++ | 内存使用 | 0.32 MiB |
| 提交时间 | 2014-11-04 19:58:23 | ||
#include<cstdio>
#include<iostream>
using namespace std;
int n,m,f[22][22];
int main() {
freopen("horse.in","r",stdin);
freopen("horse.out","w",stdout);
cin>>m>>n;
f[1][1]=1;
for(int i=2;i<=n;i++)
for(int j=1;j<=m;j++)
f[j][i]=f[j-1][i-2]+f[j-2][i-1]+f[j+1][i-2]+f[j+2][i-1];
cout<<f[m][n];
fclose(stdin);
fclose(stdout);
return 0;
}