Skip to content

Commit 68ff53b

Browse files
committed
[BOJ] 동전 1 / 골드 4 / 80분 힌트사용
https://www.acmicpc.net/problem/2293
1 parent 4ef0259 commit 68ff53b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
n, k = map(int, input().split())
2+
3+
coin = []
4+
dp = [0] * (k + 1)
5+
6+
for _ in range(n):
7+
coin.append(int(input()))
8+
9+
coin.sort()
10+
dp[0] = 1
11+
12+
for c in coin:
13+
for i in range(c, k+1):
14+
dp[i] += dp[i-c]
15+
16+
print(dp[k])

0 commit comments

Comments
 (0)