Advertisement
Ser1ousSAM

21 max

Jun 23rd, 2021
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. def F(x, y, pos):
  2.     if x+y >= 88 and (pos == 5 or pos == 3):
  3.         return True
  4.     if x+y < 88 and pos >= 5:
  5.         return False
  6.     if x+y >= 88 and pos < 5:
  7.         return False
  8.     if pos % 2 == 0:
  9.         return F(x + 1, y, pos + 1) or F(x * 3, y, pos + 1) or F(x, y+1, pos + 1) or F(x, y*3, pos + 1)
  10.     else:
  11.         return F(x + 1, y, pos + 1) and F(x * 3, y, pos + 1) and F(x, y+1, pos + 1) and F(x, y*3, pos + 1)
  12.  
  13. def F1(x, y, pos):
  14.     if x+y >= 88 and pos == 3:
  15.         return True
  16.     if x+y < 88 and pos >= 3:
  17.         return False
  18.     if x+y >= 88 and pos < 3:
  19.         return False
  20.     if pos % 2 == 0:
  21.         return F1(x + 1, y, pos + 1) or F1(x * 3, y, pos + 1) or F1(x, y+1, pos + 1) or F1(x, y*3, pos + 1)
  22.     else:
  23.         return F1(x + 1, y, pos + 1) and F1(x * 3, y, pos + 1) and F1(x, y+1, pos + 1) and F1(x, y*3, pos + 1)
  24.  
  25. for i in range(1, 72):
  26.     if F(6, i, 1):
  27.         print(i)
  28. print("anothr")
  29.  
  30. for i in range(1, 72):
  31.     if F1(6, i, 1):
  32.         print(i)
  33.  
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement