티스토리 뷰
https://www.acmicpc.net/problem/11052
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include <iostream> #include <algorithm> using namespace std; int set_price[1001]; int dp[1001]; int main() { int t; cin >> t; for (int i = 1; i <= t; i++) { cin >> set_price[i]; } for (int i = 1; i <= t; i++) { for (int j = 1; j <= i; j++) { dp[i] = max(dp[i], set_price[j] + dp[i - j] ); } } cout << dp[t]; } | cs |
'알고리즘 > DP' 카테고리의 다른 글
BOJ)11057 오르막수(다시보기) (0) | 2017.06.21 |
---|---|
BOJ)10844 쉬운 계단 수(다시보기) (0) | 2017.06.21 |
BOJ)9095 1, 2, 3 더하기 (0) | 2017.06.20 |
BOJ)11727 2xn 타일링 2 (0) | 2017.06.20 |
BOJ)11726 2xn 타일링(다시 보기) (0) | 2017.06.20 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- XAML
- 스택
- C++
- Grid
- FEED
- Cell Animation
- BOJ
- UIView Animation
- Fakebook
- 생활코딩
- dfs
- 백준
- Add TapGesture
- CustomCollectionViewCell
- 객체
- 백준온라인
- 문자열
- 데이터 바인딩
- Custom Cell
- MVVM
- command
- CollectionView
- 코딩야학
- WPF
- 타일링
- 그래프
- listview
- DP
- BFS
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함