version https://git-lfs.github.com/spec/v1oid sha256:48075317d1e9f69a577340e92b99cbff5afd5cedb329944c13617bdfc7d9304esize 1328

Williams Brown

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor, alias aspernatur quam voluptates sint, dolore doloribus voluptas labore temporibus earum eveniet, reiciendis.

Latest Posts



Archive


Tags


There’s no content to show here yet.

#include#includeusing namespace std;int changes[6];int dp[1001];int dp1[1001];int main() { int n, m; cin >> n >> m; for (int i = 0; i < n; i++) cin >> changes[i]; dp1[m] = 1; for (int i = 0; i < n; i++) { int k = 0; int cnt = m; for (int j = 1; j * changes[i] <= m; j++) { dp1[m-j*changes[i]] = dp1[m - j * changes[i]] + dp1[0]; } } cout << dp1[m];}//if(j*changes[i]+changes[i+1]){// dp[++dp[0]]=j*changes[i]+changes[i+1]