解题思路:动态规划
注意事项:
参考代码:
a, b, c, d = map(int, input().split())
stop_point = [(0, 0), (-1, -2), (1, -2), (-1, 2), (1, 2), (2, 1), (2, -1), (-2, 1), (-2, -1)]
result = [[0 for _ in range(30)] for _ in range(30)]
bool_point = [[0 for _ in range(30)] for _ in range(30)]
result[2][1] = 1
a += 2
b += 2
c += 2
d += 2
for dx,dy in stop_point:
bool_point[c + dx][d + dy] = 1
for i in range(2, a + 1):
for j in range(2, b + 1):
if bool_point[i][j]:
continue
else:
result[i][j] = result[i - 1][j] + result[i][j - 1]
print(result[a][b])
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题8.9 (C++代码)浏览:919 |
数列 (C++代码)浏览:707 |
模拟计算器 (C语言代码)浏览:966 |
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:556 |
2005年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:530 |
用筛法求之N内的素数。 (C语言代码)浏览:1385 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:611 |
兰顿蚂蚁 (C++代码)浏览:1160 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:588 |
The 3n + 1 problem (C语言代码)浏览:603 |