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 "molecules.h"
#include<algorithm>
#include<assert.h>
#include<numeric>
using namespace std;
using ll = long long;
vector<int> find_subset(int weight_low, int weight_hi, vector<int> w) {
vector<ll> v(w.begin(), w.end());
sort(v.begin(), v.end());
sort(w.begin(), w.end());
int n = v.size();
for(int l = 0; l < n; ++l){
for(int r = l; r < n; ++r){
ll sum = accumulate(v.begin() + l, v.begin() + r + 1, 0ll);
if(weight_low <= sum and sum <= weight_hi){
return vector<int>(w.begin() + l, w.begin() + r + 1);
}
}
}
return vector<int>();
}
# | 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... |