일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- custom ui
- traits
- reactorkit
- swift dashed line
- swift concurrency
- UIKit
- swift custom ui
- custom navigation bar
- tusit font 추가 방법
- RxSwift
- Tuist
- uikit toast
- coordinator
- domain data
- task cancellation
- swift 백준
- paragraph style
- button configuration
- swift bottomsheet
- custombottomsheet
- DP
- swift navigationcontroller
- rxdatasources
- task cancel
- SWIFT
- 타임라인 포맷팅
- swift 점선
- BFS
- identifiable
- claen architecture
- Today
- Total
목록BFS (2)
김경록의 앱 개발 여정

https://www.acmicpc.net/problem/7569 풀이 아이디어그래프 탐색 문제입니다.Y축까지 있으므로 3차원 배열을 사용합니다.이동 방향은 기본적인 상하좌우에서 위 아래가 추가된 6개로 이동합니다. 자세한 풀이는 아래와 같습니다. 풀이import Foundation// 가로(m), 세로(n), 높이(h)let input = readLine()!.split(separator: " ").map { Int($0)! }let m = input[0], n = input[1], h = input[2]// 3차원 배열 graph[h][n][m] 초기화var graph = [[[Int]]]()for _ in 0..= h || ny = n || nx = m { continue ..

https://www.acmicpc.net/problem/1303 풀이 아이디어그래프 탐색문제입니다.적군과 아군의 경우 모두 조사해야합니다.매번 bfs로 탐색하여 결과값의 제곱만큼 += 해주어 결과를 출력합니다.자세한 풀이는 아래와 같습니다. 풀이let nm = readLine()!.split(separator: " ").map { Int($0)! }let (m, n) = (nm[0], nm[1])let dn = [0, 0, -1, 1]let dm = [-1, 1, 0, 0]var graph = [[String]]()var isVisited = Array(repeating: Array(repeating: false, count: m), count: n)var whiteCount = 0var blueCou..