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 <algorithm>
#include <vector>
#include "molecules.h"
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
std::vector<int> ret, ret2;
std::sort(w.begin(),w.end());
int hi=w.size()-1, L=l, U=u;
while(L > 0 && U > 0 && hi >= 0){
if(U-w[hi] >= 0){
ret.push_back(w[hi]);
L -= w[hi];
U -= w[hi];
}
hi--;
}
if(L <= 0 && U >= 0) return ret;
return ret2;
}
# | 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... |