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>
#include "molecules.h"
using namespace std;
const int maxn = 1e4 + 10;
int n;
int bio[maxn];
vector<int> find_subset(int l, int u, vector<int> w) {
n = w.size();
bio[0] = 0;
for(int i = 0; i < n; i++){
for(int j = maxn - 1; j >= 0; j--){
if(bio[j] != -1 && j + w[i] <= u && bio[j + w[i]] == -1){
bio[j + w[i]] = i;
}
}
}
int x = 0;
for(int i = l; i <= u; i++){
if(bio[i]){
x = i;
break;
}
}
vector <int> v;
while(x){
v.push_back(bio[x]);
x -= w[bio[x]];
}
reverse(v.begin(), v.end());
return v;
}
# | 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... |