k1alo

123123123

Mar 14th, 2025
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. def f(x, y, last_cmd = None):
  2.     if x > y:
  3.         return 0
  4.     if x == y:
  5.         return 1
  6.     if last_cmd == "C" and x < y:
  7.         return f(x + 3, y, "B") * f(x * 4, y, "C")
  8.     if x < y:
  9.         return f(x + 2, y, "A") * f(x + 3, y, "B") * f(x * 4, y, "C")
  10.  
  11. print(f(1, 50))
Advertisement
Add Comment
Please, Sign In to add comment