# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
971382 | 2024-04-28T12:35:13 Z | Sunbae | Ice Hockey World Championship (CEOI15_bobek) | C++17 | 387 ms | 10684 KB |
#include <bits/stdc++.h> typedef long long ll; using namespace std; const int N = 44; vector<ll> v, a1, a2; signed main(){ int n; ll m; scanf("%d %lld", &n, &m); int k = n/2; for(int i = 0; i<k; ++i){ ll x; scanf("%lld", &x); a1.push_back(x); } for(int i = k; i<n; ++i){ ll x; scanf("%lld", &x); a2.push_back(x); } int sz1 = a1.size(), sz2 = a2.size(); for(int mask = 0; mask < (1<<sz1); ++mask){ ll sum = 0; for(int i = 0; i<sz1; ++i) if(mask>>i&1) sum += a1[i]; v.push_back(sum); } sort(v.begin(), v.end()); ll cnt = 0; for(int mask = 0; mask < (1<<sz2); ++mask){ ll sum = 0; for(int i = 0; i<sz2; ++i) if(mask>>i&1) sum += a2[i]; cnt += upper_bound(v.begin(), v.end(), m - sum) - v.begin(); } printf("%lld", cnt); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 436 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 1 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 26 ms | 984 KB | Output is correct |
2 | Correct | 85 ms | 2512 KB | Output is correct |
3 | Correct | 380 ms | 10684 KB | Output is correct |
4 | Correct | 83 ms | 2512 KB | Output is correct |
5 | Correct | 14 ms | 984 KB | Output is correct |
6 | Correct | 7 ms | 728 KB | Output is correct |
7 | Correct | 13 ms | 1072 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 36 ms | 1492 KB | Output is correct |
2 | Correct | 28 ms | 984 KB | Output is correct |
3 | Correct | 169 ms | 5716 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 6 ms | 728 KB | Output is correct |
6 | Correct | 14 ms | 1240 KB | Output is correct |
7 | Correct | 13 ms | 984 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 60 ms | 1492 KB | Output is correct |
2 | Correct | 135 ms | 2512 KB | Output is correct |
3 | Correct | 128 ms | 2508 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 81 ms | 2512 KB | Output is correct |
6 | Correct | 231 ms | 9664 KB | Output is correct |
7 | Correct | 74 ms | 2512 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 297 ms | 5324 KB | Output is correct |
2 | Correct | 25 ms | 980 KB | Output is correct |
3 | Correct | 9 ms | 724 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 7 ms | 728 KB | Output is correct |
6 | Correct | 159 ms | 4556 KB | Output is correct |
7 | Correct | 13 ms | 980 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 27 ms | 984 KB | Output is correct |
2 | Correct | 80 ms | 2508 KB | Output is correct |
3 | Correct | 8 ms | 728 KB | Output is correct |
4 | Correct | 8 ms | 728 KB | Output is correct |
5 | Correct | 100 ms | 2512 KB | Output is correct |
6 | Correct | 20 ms | 1240 KB | Output is correct |
7 | Correct | 224 ms | 10172 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 328 ms | 10324 KB | Output is correct |
2 | Correct | 30 ms | 984 KB | Output is correct |
3 | Correct | 8 ms | 724 KB | Output is correct |
4 | Correct | 387 ms | 10440 KB | Output is correct |
5 | Correct | 118 ms | 5400 KB | Output is correct |
6 | Correct | 14 ms | 984 KB | Output is correct |
7 | Correct | 26 ms | 1488 KB | Output is correct |