dxnge

tsk 7

Nov 5th, 2021
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. from itertools import permutations, product
  2. gens = len([f for f in permutations(range(10), r=6) if f[0] != 0 and all(sum(x) % 2 != 0 for x in zip(f, f[1:]))])
  3. genf = len([a for a in product(range(10), repeat=4) if a[0] != 0 and all(s[0] != s[1] for s in zip(a, a[1:]))])
  4. print([gens, genf].index(max(gens, genf))+1, max(gens, genf) - min(gens, genf))
  5.  
Advertisement
Add Comment
Please, Sign In to add comment