提交时间:2023-12-16 08:34:40
运行 ID: 116121
# include <bits/stdc++.h> using namespace std ; int num [114514] , dp [114514] = { 1 } , c , a ; int main ( ) { cin >> c >> a ; for ( int i = 1 ; i <= c ; i ++ ) { cin >> num [i] ; } for ( int i = 1 ; i <= a ; i ++ ) { for ( int j = 1 ; j <= c ; j ++ ) { if ( i - num [j] >= 0 ) { / dp [i] += dp [i - num [j]] ; } } } cout << dp [a] << endl ; return 0 ; }