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>
#ifndef ARTHUR_LOCAL
#include "molecules.h"
#endif
using namespace std;
vector<int> find_subset(int l, int u, vector<int> W)
{
vector<int> use;
int cur = 0;
for(auto w:W)
{
if(w>=l && w<=u)
{
return {w};
}
if(w<l)
{
use.push_back(w);
cur += w;
if(cur > u) break;
}
}
while(cur>u)
{
if(use.empty()) return {};
cur -= use.back();
use.pop_back();
}
if(use.empty()) return {};
else return use;
}
# | 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... |