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;
vector<int> find_subset(int l, int u, vector<int> w) {
vector<pair<int,int>> a;
for(int i=0;i<(int)w.size();i++) a.push_back({w[i],i});
sort(a.begin(),a.end());
long long s=0;
for(int i=0,j=0;i<(int)w.size();i++)
{
s+=a[i].first;
while(s>u) s-=a[j++].first;
if(s>=l)
{
vector<int> ans;
for(int k=j;k<=i;k++) ans.push_back(a[k].second);
return ans;
}
}
return {};
}
# | 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... |