====== Coins ====== ===== 풀이 ===== * [[ps:problems:boj:9084]]와 동일한 문제 * [[ps:배낭 문제#Coin Change Problem]]의 표준적인 문제. 풀이는 그쪽 참고. ===== 코드 ===== """Solution code for "BOJ 3067. Coins". - Problem link: https://www.acmicpc.net/problem/3067 - Solution link: http://www.teferi.net/ps/problems/boj/3067 Tags: [DP] """ def main(): T = int(input()) for _ in range(T): N = int(input()) # pylint: disable=unused-variable coins = [int(x) for x in input().split()] M = int(input()) dp = [1] + [0] * M for coin in coins: for i in range(M - coin + 1): dp[i + coin] += dp[i] print(dp[M]) if __name__ == '__main__': main() {{tag>BOJ ps:problems:boj:골드_5}}