Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Coin Combinations I CSES dynamic programming problem set solution

 Coin Combinations I CSES dynamic programming problem set solution -

Problem statement-
Consider a money system consisting of n coins. Each coin has a positive integer value. Your task is to calculate the number of distinct ways you can produce a money sum x using the available coins.

For example, if the coins are {2,3,5} and the desired sum is 9, there are 8 ways:
  • 2+2+5
  • 2+5+2
  • 5+2+2
  • 3+3+3
  • 2+2+2+3
  • 2+2+3+2
  • 2+3+2+2
  • 3+2+2+2
Input

The first input line has two integers n and x: the number of coins and the desired sum of money.

The second line has 


This post first appeared on Technical Keeda, please read the originial post: here

Share the post

Coin Combinations I CSES dynamic programming problem set solution

×

Subscribe to Technical Keeda

Get updates delivered right to your inbox!

Thank you for your subscription

×