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) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n = w.size();
sort(w.begin(), w.end());
for (int i = 0, j = 0, sum = 0; i < n; i++) {
sum += w[i];
while (sum > u && j < i) sum -= w[j++];
if (l <= sum && sum <= u) {
vector<int> ans;
for (int k = j; k <= i; k++) ans.push_back(w[k]);
return ans;
}
}
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... |