| 记录编号 | 359370 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 49.跳马问题 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.003 s | ||
| 提交时间 | 2016-12-22 13:58:06 | 内存使用 | 4.11 MiB | ||
#include<iostream>
#include<cstdio>
using namespace std;
int f[998][998];
int main(){
freopen("horse.in", "r", stdin);
freopen("horse.out", "w", stdout);
int n,m;
cin>>m>>n;
f[1][1]=1;
for(int i=2;i<=n;i++)
for(int j=1;j<=m;j++)
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][m];
return 0;
}