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>
using namespace std;
#include "molecules.h"
const int MN=1e5+5;
vector<int> find_subset(int l, int u, vector<int> w){
vector<bool>dp(MN,false);
int n=w.size();
dp[0]=1;
vector<vector<int>>res;
for(int i=0;i<n;i++){
for(int j=MN;j>=0;j--){
if(j>=w[i] && dp[j-w[i]]==true){
res[j]=res[j-w[i]];
dp[j]=true;
res[j].push_back(i);
}
}
}
for(int i=l;i<=u;i++){
if(dp[i]){
return res[i];
}
}
return 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... |