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
- swift 백준
- RxSwift
- scene delegate
- BFS
- task cancellation
- Tuist
- swift 점선
- UIKit
- claen architecture
- identifiable
- rxdatasources
- DP
- custombottomsheet
- traits
- task cancel
- coordinator
- swift bottomsheet
- swift dashed line
- domain data
- uikit toast
- custom ui
- reactorkit
- SWIFT
- swift concurrency
- button configuration
- 버튼 피드백
- 타임라인 포맷팅
- swift custom ui
- custom navigation bar
- swift navigationcontroller
Archives
- Today
- Total
목록DP (2)
김경록의 앱 개발 여정

https://www.acmicpc.net/problem/11052 풀이 아이디어- 문제를 요약하면 결국 n개의 카드를 가장 비싸게 사는 법을 구하기- 즉, 카드 개수를 정확히 N개가 되도록 여러 개의 카드팩을 조합해서 가장 비싸게 구매하는 방법을 찾기- DP 사용점화식은 아래와 같다dp[i] = max(dp[i], dp[i-j] + input[j-1])i장을 구매할 때,j장짜리 카드팩을 한 번 사고,나머지 i-j장을 가장 비싸게 살 방법을 dp[i-j]에서 가져오는 것.풀이let n = Int(readLine()!)!let input = readLine()!.split(separator: " ").map {Int($0)!}var dp = [Int](repeating: 0, count: n+1)for i..
Algorithm
2025. 4. 3. 14:27

https://www.acmicpc.net/problem/9465 풀이 아이디어 일정한 규칙성이 있어서 dp로 풀이했습니다.점화식은 아래와 같습니다. dp[0][i] = max(dp[1][i-1], dp[1][i-2]) + board[0][i]dp[1][i] = max(dp[0][i-1], dp[0][i-2]) + board[1][i]n이 1인 경우등도 잘 신경써줍니다(한번 틀림..)자세한 풀이는 아래와 같습니다. 풀이let t = Int(readLine()!)!for _ in 0..
Algorithm
2025. 3. 28. 22:47