
파이썬 백준 1759번: 암호 만들기
·
Algorithm/python 백준
문제 https://www.acmicpc.net/problem/1759 1759번: 암호 만들기 첫째 줄에 두 정수 L, C가 주어진다. (3 ≤ L ≤ C ≤ 15) 다음 줄에는 C개의 문자들이 공백으로 구분되어 주어진다. 주어지는 문자들은 알파벳 소문자이며, 중복되는 것은 없다. www.acmicpc.net 풀이 백트래킹을 이용해서 해결했다. import sys def backtracking(): if len(password)==L: cnt=0 for i in vowel: # 모음의 수 확인 cnt+=password.count(i) if cnt>0 and L-cnt>1: print("".join(map(str,password))) return for i in word: if i not in passw..