Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import *
- count = 0
- for elem in product("ПРОСТО", repeat = 6):
- if elem.count("П") == 1 and elem.count("Р") == 1 and elem.count("О") == 2 and elem.count("С") == 1 and elem.count("Т") == 1:
- pov = 0
- for i in range(1, len(elem)):
- if elem[i] == elem[i-1]:
- pov += 1
- if pov == 0:
- count += 1
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment