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> find_subset(int l, int u, vector<int> w) {
int dp[u+1];
dp[0]=1;
vector<int>ans;
bool found=false;
for(auto z : w) {
if(z > u) continue;
for(int i = u ; i >= z ; i--) {
if(dp[i-z]) {
dp[i]=z;
if(i >= l) {
int pos = i;
while(pos>0) {
ans.push_back(dp[pos]);
pos-=dp[pos];
found=true;
}
break;
}
}
}
if(found) break;
}
return ans;
}
# | 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... |