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;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<pair<int, vector<int>>> dp;
dp.push_back({0, {}});
for (unsigned int i = 0; i < w.size(); i++) {
for (int j = dp.size()-1; j >= 0; j--) {
int we; vector<int> contents;
tie(we, contents) = dp[j];
if (we+w[i] <= u) {
contents.push_back(i);
if (we+w[i] >= l) return contents;
dp.push_back({we+w[i], contents});
}
}
}
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... |