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 pii = pair<int, int>;
using ll = long long;
vector<int> find_subset(int l, int u, vector<int> w) {
int n = w.size();
vector<pii> W;
for (int i = 0; i < n; ++i)
W.emplace_back(w[i], i);
sort(W.begin(), W.end());
ll sum = 0;
int j = 0;
vector<int> ans;
for (int i = 0; i < n; ++i) {
sum += W[i].first;
while (sum > u)
sum -= W[j++].first;
if (sum >= l) {
for (int k = j; k <= i; ++k)
ans.push_back(W[k].second);
break;
}
}
return ans;
}
# | 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... |