Toggle navigation
点码成金编程
F.A.Qs
ProblemSet
Source/Category
Status
Ranklist
Contest
Login
Home
=>
ProblemSet
=> 4.2-04:函数
Problem1286--4.2-04:函数
1286: 4.2-04:函数
Time Limit:
1
Sec
Memory Limit:
128 MB
Submit:
3
Solved:
2
[
Submit
] [
Status
] [ Creator:
][ 参考程序 ]
Description
定义函数G(x, y)为:
G(x, y) = 1 x <= 0 或 y <= 0
G(x, y) = G(x - 1, y) + 2 * G(x - 1, y - 1) + 3 * G(x, y - 1) x>0 或 y > 0
编写程序,使其可以输出G(x, y)
Input
两个正整数x, y
Output
一个正整数G(x, y)
Sample Input
Copy
1 1
Sample Output
Copy
6
HINT
1≤x, y≤10
Source/Category
算法
递归