Advertisement
qekaqeka

code

Apr 9th, 2023
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import itertools
  2.  
  3. c = 0
  4.  
  5. for i in itertools.permutations("МИТРОФАН", r = 6):
  6. i = ''.join(i)
  7. gcount = i.count('И') + i.count('А') + i.count('О')
  8. if gcount >= 3:
  9. continue
  10. f = False
  11. for j in itertools.product('ИОА', repeat=2):
  12. j = ''.join(j)
  13. if j in i:
  14. f = True
  15. break
  16. if f:
  17. continue
  18.  
  19. c += 1
  20. print(c)
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement