Farz0l1x

Untitled

Feb 21st, 2024
811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. from itertools import *
  2. count = 0
  3. A = []
  4. for elem in product("ПРОСТО", repeat = 6):
  5.     if elem.count("П") == 1 and elem.count("Р") == 1 and elem.count("О") == 2 and elem.count("С") == 1 and elem.count("Т") == 1:
  6.         for i in range(len(elem)):
  7.             s =''
  8.             s += elem[i]
  9.             A.append(s)
  10. for i in range(len(A)):
  11.     if 'ОО' not in A[i]:
  12.         count += 1
  13. print(count)
Advertisement
Add Comment
Please, Sign In to add comment