Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions dohyeondol1/DP/11-dohyeondol1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <iostream>
#include <vector>
using namespace std;

int main() {
int n, k;
cin >> n >> k;
vector<int> coin(n);
vector<int> dp(k+1);
for(auto& c : coin)
cin >> c;

dp[0] = 1;
for(int i = 0; i < n; i++)
for(int j = coin[i]; j <= k; j++)
dp[j] += dp[j - coin[i]];

cout<< dp[k] << '\n';

return 0;
}
3 changes: 3 additions & 0 deletions dohyeondol1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
| 6μ°¨μ‹œ | 2025.04.05 | DP | [ν‰λ²”ν•œ λ°°λ‚­](https://www.acmicpc.net/problem/12865)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/22|
| 7μ°¨μ‹œ | 2025.04.08 | 트리 | [트리 순회](https://www.acmicpc.net/problem/1991)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/26|
| 8μ°¨μ‹œ | 2025.04.11 | 덱 | [νšŒμ „ν•˜λŠ” 큐](https://www.acmicpc.net/problem/1021)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/32|
| 9μ°¨μ‹œ | 2025.04.30 | 그리디 μ•Œκ³ λ¦¬μ¦˜ | [체윑볡](https://school.programmers.co.kr/learn/courses/30/lessons/42862)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/33|
| 10μ°¨μ‹œ | 2025.05.04 | μ™„μ „ 탐색 | [μ†Œμˆ˜ μ°ΎκΈ°](https://school.programmers.co.kr/learn/courses/30/lessons/42839)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/37|
| 11μ°¨μ‹œ | 2025.05.06 | DP | [동전 1](https://www.acmicpc.net/problem/2293)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/39|