# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
858957 | 2023-10-09T13:07:10 Z | Tenis0206 | Ice Hockey World Championship (CEOI15_bobek) | C++11 | 291 ms | 22712 KB |
#include <bits/stdc++.h> using namespace std; const int nmax = 40; int n,m; int v[nmax + 5]; int main() { ios::sync_with_stdio(false); cin.tie(0); cin>>n>>m; for(int i=1;i<=n;i++) { cin>>v[i]; } int sz_a = n / 2; int sz_b = n - sz_a; vector<long long> a,b; for(int mask=0;mask<(1<<sz_a);mask++) { long long sum = 0; for(int b=0;b<sz_a;b++) { if((mask & (1<<b))!=0) { sum += v[b + 1]; } } a.push_back(sum); } for(int mask=0;mask<(1<<sz_b);mask++) { long long sum = 0; for(int b=0;b<sz_b;b++) { if((mask & (1<<b))!=0) { sum += v[sz_a + b + 1]; } } b.push_back(sum); } sort(a.begin(),a.end()); sort(b.begin(),b.end()); int poz = b.size() - 1; long long rez = 0; for(int i=0;i<a.size();i++) { while(poz >= 0 && a[i] + b[poz] > m) { --poz; } rez += poz + 1; } cout<<rez<<'\n'; return 0; }
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 | 0 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 | 456 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 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 23 ms | 2144 KB | Output is correct |
2 | Correct | 69 ms | 5584 KB | Output is correct |
3 | Correct | 291 ms | 22712 KB | Output is correct |
4 | Correct | 77 ms | 5572 KB | Output is correct |
5 | Correct | 12 ms | 1884 KB | Output is correct |
6 | Correct | 8 ms | 1084 KB | Output is correct |
7 | Correct | 16 ms | 1756 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 32 ms | 3032 KB | Output is correct |
2 | Correct | 24 ms | 2140 KB | Output is correct |
3 | Correct | 120 ms | 11524 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 6 ms | 1116 KB | Output is correct |
6 | Correct | 15 ms | 1756 KB | Output is correct |
7 | Correct | 16 ms | 1632 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 59 ms | 3668 KB | Output is correct |
2 | Correct | 103 ms | 7500 KB | Output is correct |
3 | Correct | 107 ms | 7972 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 73 ms | 7448 KB | Output is correct |
6 | Correct | 259 ms | 21944 KB | Output is correct |
7 | Correct | 103 ms | 8528 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 125 ms | 13080 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 2144 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 168 ms | 21660 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |