# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
74554 | Adhyyan1252 | Ice Hockey World Championship (CEOI15_bobek) | C++11 | 357 ms | 33816 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;
typedef long long ll;
ll n, m;
vector<ll> a, b, c;
void brute(int i, int e, ll cost){
if(i == e+1){
b.push_back(cost);
return;
}
brute(i+1, e, cost + a[i]);
brute(i+1, e, cost);
}
int main(){
cin>>n>>m;
a.resize(n);
for(int i = 0; i < n; i++){
cin>>a[i];
}
b.reserve(1000000); c.reserve(1000000);
brute(0, n/2, 0);
c = b;
b.clear();
brute(n/2+1, n-1, 0);
ll ans =0 ;
sort(b.begin(), b.end());
sort(c.begin(), c.end());
int pntr = c.size() - 1;
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... |