Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- memory
- 알고리즘
- 백준
- 일상
- 리덕스장바구니
- error
- react-redux
- OS
- Redux
- 토이프로젝트
- Spring
- 코드업
- 분할메모리할당
- Operating System
- 파이썬
- 기초100제
- 정렬
- Java
- web
- 협업
- 자료구조
- 타입스크립트
- CPU 스케줄링
- 프로그래머스
- 스프링
- 공부
- codeup
- react
- js to ts
- C++
Archives
- Today
- Total
목록백트래킹 (1)
감자튀김 공장🍟

✔ 문제 ✔ 풀이 import sys input = sys.stdin.readline n = int(input()) graph = [0] * n count = 0 def is_promising(x): for i in range(x): if graph[x] == graph[i] or abs(graph[x] - graph[i]) == x - i: return False return True def queen(x): global count if x == n: count += 1 return else: for i in range(n): graph[x] = i if is_promising(x): queen(x+1) queen(0) print(count) ✔ 설명 #Tip 1. 굳이 2차원 배열을 쓸 필요가 없다...
Algorithm/BOJ
2023. 1. 1. 20:56