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"
std::vector<int> find_subset(int L, int U, std::vector<int> w) {
std::vector<int> v = w;
int n = w.size();
int l = 0, r = 0, sum = 0;
std::vector<int> ans;
while(r < n)
{
sum += v[r];
while(sum > U)
{
sum -= w[l];
l++;
}
if(L <= sum && sum <= U)
{
for(int i = l; i<=r; i++)ans.push_back(i);
return ans;
}
r++;
}
return std::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... |