This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
///~~~LOTA~~~///
#include <bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l,int r,vector<int> w){
bitset<500001> dp;
int n=w.size();
dp[0]=1;
for(auto& i:w)
dp|=dp<<i;
int o=0;
for(int i=l;i<=r;i++)
if(dp[i]) o=i;
vector<int> v;
for(int i=0;i<n;i++){
if(w[i]>o) continue;
if(dp[o-w[i]]){
o-=w[i];
v.push_back(i);
}
}
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... |