Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=17328
- alph = 'ГЕРАСИМ'
- gl = 'ЕАИ'
- sogl = 'ГРСМ'
- cnt = 0
- for q in alph:
- for w in alph:
- for e in alph:
- for r in alph:
- for t in alph:
- for y in alph:
- for u in alph:
- s = q + w + e + r + t + y + u
- if len(set(s)) != 7:
- continue
- f = True
- for i in range(1, 7):
- if not ((s[i - 1] in gl and s[i] in sogl) or (s[i - 1] in sogl and s[i] in gl)):
- f = False
- if f:
- cnt += 1
- print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment