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 <algorithm>
#include "molecules.h"
using namespace std;
typedef long long int ll;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<int> V;
ll N=w.size();
ll S=0;
vector<pair<ll,int>> W;
for(ll i=0;i<N;i++)
W.push_back({w[i],i});
sort(W.begin(), W.end());
for(ll a=0,b=0;a<N;a++){
S-=a?W[a-1].first:0;
while(l>S and b<N)
S+=W[b++].first;
if(l<=S and S<=u){
for(ll i=a;i<b;i++)
V.push_back(W[i].second);
return V;
}
}
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... |