"Dynamic planning" currency system issue time limit: 1 Sec memory limit: up to MB Title Descriptionmoney is a special commodity that acts as an equivalent in the exchange of goods and services in the state or economy, or as a debt-servicing instrument, and is used as a tool for trading media, storage value and accounting units. The history of the Wizarding world's currency can be traced back to the prehistoric stage of barter, later through the metal currency, gold and silver, banknotes and gold and silver standard system, evolved into the modern monetary system, now known as the Magic world of the monetary system has v face value, for the composition of the value of the currency of n how many kinds of solutions. InputThe first behavior of two integers V and n,v is the number of currency types, 1≤v≤25,n is the face value to construct, 1≤n≤1000.
The second act is the face value of the V currency. OutputThe number of output scenarios. Sample input
3 101 2 5
Sample output
10
#include <iostream>#include<cstring>using namespacestd;intn,m,a[ -],f[1111];intMain () { while(cin>>n>>m) { for(intI=0; i<n;i++) Cin>>A[i]; Memset (F,0,sizeof(f)); f[0]=1; for(intI=0; i<n;i++) for(intj=a[i];j<=m;j++) {F[j]=f[j]+f[j-A[i]]; } cout<<f[m]<<Endl; } return 0;}
"Dynamic planning" currency system issues