We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee6ecef commit e4858cbCopy full SHA for e4858cb
_WeeklyChallenges/W14-[DP]/Study_BOJ_2293_동전 1.py
@@ -0,0 +1,22 @@
1
+'''
2
+BOJ #2293. 동전 1 (골드4)
3
+https://www.acmicpc.net/problem/2293
4
+유형: DP
5
6
+
7
+n, k = map(int, input().split())
8
9
+coin = []
10
+dp = [0] * (k + 1)
11
12
+for _ in range(n):
13
+ coin.append(int(input()))
14
15
+coin.sort()
16
+dp[0] = 1
17
18
+for c in coin:
19
+ for i in range(c, k+1):
20
+ dp[i] += dp[i-c]
21
22
+print(dp[k])
0 commit comments