Forezz

ДЗ 13 Н 3

Aug 9th, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. x = int(input())
  2. y = int(input())
  3. a = [[0]  * x for i in range (y - 1)] + [[1] * x]
  4. for i in range (y - 1):
  5.     a[i][x - 1] = 1
  6. for i in range(2, y + 1):
  7.     for j in range(2, x + 1):
  8.         a[y - i][x - j] = a[y - i + 1][x - j] + a[y - i][x - j + 1]    
  9. print (a[0][0])
Advertisement
Add Comment
Please, Sign In to add comment