zhukov000

Untitled

Nov 2nd, 2021
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. from functools import lru_cache
  2.  
  3. # +1, *3
  4. # 65 <= WIN <= 100
  5. @lru_cache(None)
  6. def F(a):
  7.   if (65 <= a + 1 <= 100) or (65 <= a * 3 <= 100):
  8.     return 1
  9.  
  10.   lst = [ ]
  11.   if a + 1 <= 100:
  12.     lst.append( F(a + 1) )
  13.   if a * 3 <= 100:
  14.     lst.append( F(a * 3) )
  15.  
  16.   if min(lst) > 0:
  17.     return -max(lst)
  18.   return 1 - max([x for x in lst if x < 0])
  19.  
  20. for s in range(1, 65):
  21.   if F(s) == -2:
  22.     print(s)
  23.  
Advertisement
Add Comment
Please, Sign In to add comment