https://www.acmicpc.net/problem/1062 - pypy3로 통과import sysinput = sys.stdin.readline# 배울 수 있는 경우의 수 다 구하고 # 각 경우의 수가 완성되면 배울 수 있는 단어 개수 비교# n으로 글자수 카운트def dfs(x, n): global dap if n == K: cnt = 0 for i in li: boo = True for j in i: # 배우지 않은 글자가 포함이면 False if visited[ord(j)-ord('a')] == 0: boo = False ..
https://www.acmicpc.net/problem/9663 import sysinput = sys.stdin.readlineN = int(input())ans = 0row = [0]*Ndef is_promising(x): for i in range(x): if row[x] == row[i] or abs(row[x] - row[i]) == abs(x - i): return False return Truedef n_queens(x): global ans if x == N: ans += 1 return else: for i in range(N): # [x, i]에 퀸을 놓음 ..