Advertisement
vadim_sharaf

Untitled

Oct 27th, 2021
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. def n_p(x, y):
  2.     if x > y:
  3.         return 0
  4.     if x == y:
  5.         return 1
  6.     if x == 9:
  7.         return n_p(x*2, y)
  8.     if x < y:
  9.         return n_p(x+1, y) + n_p(x*2, y)
  10. print(n_p(1, 10)*n_p(10, 20)+n_p(1, 9)*n_p(9, 20))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement