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>
typedef long long llint;
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
vector<pair<int, int>> v;
for (int i = 0; i < (int) w.size(); ++i)
v.emplace_back(w[i], i);
sort(v.begin(), v.end());
int lo = 0, hi = 1;
llint sum = (llint) v[0].first;
for (; lo < (int) v.size(); ++lo) {
while (hi < (int) v.size() && sum < l) sum += (llint) v[hi++].first;
if (sum >= l && sum <= u) break;
sum -= (llint) v[lo].first;
}
vector<int> ret;
for (int i = lo; i < hi; ++i)
ret.push_back(v[i].second);
return ret;
}
# | 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... |