-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoin Combinations I.cpp
More file actions
44 lines (37 loc) · 886 Bytes
/
Copy pathCoin Combinations I.cpp
File metadata and controls
44 lines (37 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<iostream>
#include<vector>
#include<random>
#include<chrono>
#include<algorithm>
#define SPEED ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define oo 1000000001
#define all(v) v.begin(),v.end()
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define ll long long
#define ull unsigned long long
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int sz = 110, MAX = 1e7, mod = 1e9 + 7;
#define int ll
int n, x;
int c[sz];
int dp[MAX];
signed main(){
SPEED;
cin >> n >> x;
for(register int i = 1; i <= n; ++i){
cin >> c[i];
}
dp[0] = 1;
for(register int j = 0; j <= x; ++j){
for(register int i = 1; i <= n; ++i){
if(j - c[i] >= 0) dp[j] += dp[j - c[i]];
dp[j] %= mod;
}
}
cout << dp[x] % mod << '\n';
return 0;
}