# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48058 | Extazy | Ice Hockey World Championship (CEOI15_bobek) | C++17 | 473 ms | 9176 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>
#define endl '\n'
using namespace std;
const int N = 44;
int n,n2;
long long ans,m,a[N];
vector < long long > v;
void recurse1(int pos, long long sum) {
if(pos>n2) {
v.push_back(sum);
return;
}
recurse1(pos+1,sum);
recurse1(pos+1,sum+a[pos]);
}
void recurse2(int pos, long long sum) {
if(pos>n) {
ans+=(int)(upper_bound(v.begin(),v.end(),m-sum)-v.begin());
return;
}
recurse2(pos+1,sum);
recurse2(pos+1,sum+a[pos]);
}
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... |