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){
vector<pair<long long,int>> vec;
int n = w.size();
for(int i = 0;i<n;++i) vec.push_back({w[i],i});
sort(vec.begin(),vec.end());
int r = -1; long long sum = 0;
for(int i = 0;i<n;++i){
while(r+1 < n && sum < l){
r++;
sum += vec[r].first;
}
if(l <= sum && sum <= u){
vector<int> ans;
for(int j = i;j<=r;++j) ans.push_back(vec[j].second);
return ans;
}
}
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... |