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
- 머신러닝
- dfs
- NLP
- Reinforcement Learning
- C++
- YoLO
- DP
- r-cnn
- eecs 498
- 그래프 이론
- 강화학습
- MinHeap
- image processing
- Mask Processing
- dynamic programming
- real-time object detection
- MySQL
- One-Stage Detector
- BFS
- deep learning
- ubuntu
- two-stage detector
- 백준
- CNN
- 딥러닝
- opencv
- machine learning
- AlexNet
- Python
- LSTM
Archives
- Today
- Total
목록적록색약 (1)
JINWOOJUNG

접근법 기본적인 아이디어는 DFS를 생각했고, 여기서 특이점은 R,G를 동일하게 인식해야 한다는 점이다. 따라서 DFS를 적용할 때 B가 아닌 위치를 다른 배열에 체크해 둔 후, 해당 배열에 한번 더 DFS를 적용하여 적록색약인 경우에 구역의 수를 계산 하였다. 정답 import sys sys.setrecursionlimit(10**9) dx = [0,0,-1,1] dy = [-1,1,0,0] N = int(input()) def dfs(x,y,color): image[y][x] = 0 if color != "B": check[y][x] = 1 for i in range(4): X = x + dx[i] Y = y + dy[i] if(0
백준
2023. 12. 28. 15:58