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"
#include "molecules.h"
using namespace std;
using ll = long long;
using pi = pair<long long, long long>;
using vi = vector<long long>;
#define pb emplace_back
vector<int> find_subset(int l, int u, vector<int> w) {
int n = w.size();
vector<pi> val;
for(int i = 0; i < n; ++i) {
val.pb(w[i], i);
}
sort(val.begin(), val.end());
pi ans = {-1, -1};
for(int i = 0; i < n; ++i) {
ll sum = 0;
for(int j = i; j < n; ++j) {
sum += val[j].first;
if(l <= sum && sum <= u) {
ans = {i, j};
}
}
}
vector<int> res;
pi bad = {-1, -1};
if(ans == bad) {
return res;
}
for(int i = ans.first; i <= ans.second; ++i) {
res.pb(val[i].second);
}
return res;
}
# | 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... |