Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(x, y, last_cmd = None):
- if x > y:
- return 0
- if x == y:
- return 1
- if last_cmd == "C" and x < y:
- return f(x + 3, y, "B") * f(x * 4, y, "C")
- if x < y:
- return f(x + 2, y, "A") * f(x + 3, y, "B") * f(x * 4, y, "C")
- print(f(1, 50))
Advertisement
Add Comment
Please, Sign In to add comment