Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(x, y, pos):
- if x+y>=100 and (pos==5 or pos==3):
- return True
- if x+y<100 and pos>=5:
- return False
- if x+y>100 and pos<5:
- return False
- if pos%2==0:
- return f(x+5, y, pos+1) or f(x**2, y, pos+1) or f(x, y+5, pos+1) or f(x, y**2, pos+1)
- else:
- return f(x+5, y, pos+1) and f(x**2, y, pos+1) and f(x, y+5, pos+1) and f(x, y**2, pos+1)
- def f1(x, y, pos):
- if x + y >= 100 and pos == 3:
- return True
- if x + y < 100 and pos >= 3:
- return False
- if x + y > 100 and pos < 3:
- return False
- if pos % 2 == 0:
- return f1(x + 5, y, pos + 1) or f1(x ** 2, y, pos + 1) or f1(x, y + 5, pos + 1) or f1(x, y ** 2, pos + 1)
- else:
- return f1(x + 5, y, pos + 1) and f1(x ** 2, y, pos + 1) and f1(x, y + 5, pos + 1) and f1(x, y ** 2, pos + 1)
- for i in range(1, 96):
- if f(3, i, 1):
- print(i)
- print('asdas')
- for i in range(1, 96):
- if f1(3, i, 1):
- print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement