https://www.acmicpc.net/problem/9084
아침에 풀었던 거스름돈에서 감 잡고 좀만 더 생각했으면 풀만 했을 것 같은데, 그냥 갑갑해서 빨리 얼렁뚱땅 해결.
난 난이도를 미리 알고 접근하는게 별로 싫다. 기죽잖아
import sys
input = sys.stdin.readline
caseCnt = int(input())
for i in range(caseCnt):
dp = [0] * 10001
dp[0] = 1
coinCount = int(input())
coinList = list(map(int, input().split()))[:coinCount]
destValue = int(input())
for coin in coinList:
for i in range(coin, destValue + 1):
dp[i] += dp[i - coin]
print(dp[destValue])
'문제풀이' 카테고리의 다른 글
C언어로 이분 탐색 트리 구현하기 (0) | 2025.04.14 |
---|---|
C언어로 연결 리스트 구현하기 (0) | 2025.04.11 |
[PY] 2573 : 빙산 (0) | 2025.04.10 |
[PY] 14916 : 거스름돈 (0) | 2025.04.10 |
[PY] 1890 : 점프 (0) | 2025.04.10 |