Guest User

Untitled

a guest
Jan 9th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. ans = 0
  2. otv = 0
  3. alph = list(set("qwertyuiopasdfghjklzxcvbnm"))
  4. alph.sort()
  5. isin = set()
  6. s = input()
  7. def pereb(sps):
  8. global ans
  9. global otv
  10. global isin
  11. global s
  12. global alph
  13. if len(sps) == len(s):
  14. if "".join(sps) not in isin:
  15. if "".join(sps) == s:
  16. ans += 1
  17. otv = ans
  18. isin.add("".join(sps))
  19. print("#")
  20. else:
  21. ans += 1
  22. isin.add("".join(sps))
  23. print("##")
  24. else:
  25. for i in alph:
  26. sps.append(i)
  27. ans += 1
  28. print("###")
  29. pereb(n, sps)
  30. sps.pop()
  31. pereb([])
  32. print(otv)
Add Comment
Please, Sign In to add comment