
[Beakjoon] 9663. N-Queen
·
코딩테스트/Python
🔗 Problem Linkhttps://www.acmicpc.net/problem/9663❔Thinking체스판의 퀸의 이동경로가 겹치지 않도록 N개를 놓는 방법의 수를 구한다.퀸은 상하좌우, 대각선 모두를 이동할 수 있다.💻Solutionn = int(input())def put_queen(row:int): global left_right, yx, y_x, cnt, n if row == n: cnt += 1 return for i in range(n): if left_right[i] is False and yx[row+i] is False and y_x[(n-1) + row-i] is False: left_right[i] = ..