# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
118776 | silxikys | Ice Hockey World Championship (CEOI15_bobek) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
const int maxn = 45;
int N, M;
ll A[maxn], B[maxn];
int main()
{
cin >> N >> M;
for (int i = 0; i < N; i++) {
cin >> A[i];
}
ll ans = 0;
for (int i = 0; i < (1<<N); i++) {
ll total = 0;
for (int j = 0; j < split; j++) {
if (i & (1<<j)) total += A[j];
}
if (total <= M) ans++;
}
cout << ans << '\n';
}