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 <bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
int n = w.size();
vector<pair<int,int>> v(n);
for (int i = 0; i < n; i++) v[i].first = w[i], v[i].second = i;
sort(v.begin(), v.end());
int cur = 0, ptr = 0;
for (int i = 0; i < n; i++) {
cur += v[i].first;
while (cur > u && ptr <= i) {
cur -= v[ptr].first;
ptr++;
}
if (cur >= l && cur <= u) {
vector<int> ret;
for (int j = ptr; j <= i; j++) ret.push_back(v[j].second);
return ret;
}
}
return vector<int>(0);
}
# | 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... |