| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1028257 | lmao123456 | Ice Hockey World Championship (CEOI15_bobek) | C++14 | 201 ms | 20916 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;
 
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define fi first
#define se second
 
vector<int> do_for(vector<int> v) {
    int n = v.size();
    vector<int> res;
    for(int mask = 0; mask < (1 << n); mask++) {
        int sum = 0;
        for(int i = 0; i < n; i++) {
            sum += ((mask >> i) & 1) * v[i];
        }
        res.pb(sum);
    }
    sort(res.begin(), res.end());
    return res;
}
 
void solve() {
    int n, m;
    cin >> n >> m;
    vector<int> v(n);
    for(int i = 0; i < n; i++) {
        cin >> v[i];
    }
    if(n == 1) {
        if(v[0] <= m) {
            cout << "2\n";
        } else {
            cout << "1\n";
        }
        return;
    }
    int as = n / 2;
    int bs = n - as;
    vector<int> a = v;
    a.resize(as);
    vector<int> b = v;
    reverse(b.begin(), b.end());
    b.resize(bs);
    reverse(b.begin(), b.end());
    vector<int> x = do_for(a);
    vector<int> y = do_for(b);
    reverse(y.begin(), y.end());
    int ans = 0;
    int idx = 0;
    for(int cur : x) {
        while(idx < y.size() && cur + y[idx] > m) {
            idx++;
        }
        ans += y.size() - idx;
    }
    cout << ans << "\n";
}
 
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
