Advertisement
nq1s788

23 с двумя обязательными

Jan 6th, 2024
753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. a = [0] * 31
  2. a[1] = 1
  3. for i in range(2, 11):
  4.     a[i] += a[i - 1]
  5.     if i % 2 == 0:
  6.         a[i] += a[i // 2]
  7. for i in range(11, 22):
  8.     a[i] += a[i - 1]
  9.     if i % 2 == 0 and i // 2 >= 10:
  10.         a[i] += a[i // 2]
  11. for i in range(22, 31):
  12.     a[i] += a[i - 1]
  13.     if i % 2 == 0 and i // 2 >= 21:
  14.         a[i] += a[i // 2]
  15. print(a[30])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement