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> v;
bool f(int n, int l, int u, vector<int> w) {
if(n == -1 and 0 >= l and 0 <= u){
v.push_back(n);
return true;
}
if(f(n-1, l-w[n], u - w[n], w)) {
v.push_back(n);
return true;
}
return f(n-1, l, u, w);
}
vector<int> find_subset(int l, int u, vector<int> w) {
int n = w.size();
if(f(n-1, l, u, w))return v;
else return {};
}
# | 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... |