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>
using namespace std;
using ll = long long;
vector<int> find_subset(int l, int u, vector<int> w)
{
int n = w.size();
vector<pair<ll, int>> a(n);
for (int i = 0; i < n; ++i) a[i] = {w[i], i};
sort(a.begin(), a.end());
for (int i = 0; i < n; ++i)
{
ll sum = 0;
vector<int> res;
for (int j = i; j < n; ++j)
{
sum += a[j].first;
res.push_back(a[j].second);
if (sum >= l && sum <= u) return res;
}
}
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... |